Skip to content

When using event_manager to initialize the crawler, the global event_manager doesn't work. #1808

@Mantisus

Description

@Mantisus

If event_manager is passed as an initialization parameter to BasicCrawler, the global event_manager in service_locator will never be started.

https://github.com/apify/crawlee-python/blob/master/src/crawlee/crawlers/_basic/_basic_crawler.py#L770-L778

As a result, classes that use service_locator.get_event_manager() do not behave as expected, because they do not receive the relevant events.

Classes affected by this issue: Snapshotter and RecoverableState.

Related: #1805

Also, if two crawlers share the global event_manager and one finishes before the other, the event_manager will be shut down for the second crawler as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions