-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement a way to stop crawler from the user function #2777
Comments
In addition, there is no way to stop the periodicLogger. This continues to fire after a CriticalError even if teardown() is used. |
Interesting, @danielcrabtree - can you please provide a minimal reproducible scenario? From looking into the code, it seems that the periodicLogger should definitely stop once the |
@barjin I'm using PlaywrightCrawler and if you simply If you look in the BasicCrawler code, you'll see there is only the one call to |
I see, thank you for your detailed description! I'll handle this in the currently open PR, as it seems (at least tangentially) related. Cheers! |
On second thought, the |
This is a parity-tracking issue for this PR in Crawlee for Python: apify/crawlee-python#651
Currently, to stop the crawler instance, the users can only call the
BasicCrawler.teardown()
method, which is both undocumented (has the@ignore
TypeDoc decorator) and not exactly named well.The
crawler.stop()
implementation in Crawlee for Python forces theAutoscaledPool
to not take any more tasks, but to gracefully finish the ones that are in currently in progress. This is different from theAutoscaledPool.abort
method (called bycrawler.teardown()
), which according to the docstring abandons the running tasks on spot ("all running tasks will be left in their current state").More context / discussion at https://apify.slack.com/archives/CD0SF6KD4/p1734526549266519
The text was updated successfully, but these errors were encountered: