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.
If
event_manageris passed as an initialization parameter toBasicCrawler, the globalevent_managerinservice_locatorwill 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:
SnapshotterandRecoverableState.Related: #1805
Also, if two crawlers share the global
event_managerand one finishes before the other, theevent_managerwill be shut down for the second crawler as well.