Skip to content

feat(crawlers): Add BasicCrawler.pause() and resume(), and pause on migration - #2394

Open
Mantisus wants to merge 1 commit into
apify:v2from
Mantisus:pause-resume
Open

Mantisus wants to merge 1 commit into
apify:v2from
Mantisus:pause-resume

Conversation

@Mantisus

@Mantisus Mantisus commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds BasicCrawler.pause() and resume(). pause() stops dispatching new requests and waits until the ones in progress finish, optionally within a timeout, and run() stays pending until resume() is called. Outside a run, both only log a warning.

The crawler also pauses on Event.MIGRATING and Event.ABORTING: it waits up to 20 seconds for the requests in progress and then persists its statistics, so that no request is left half-done when the process moves to another host or is aborted. Statistics gets a public persist_state() for that.

Issues

✍️ Drafted by Claude Code

@Mantisus Mantisus self-assigned this Nov 3, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 3, 2026
@Mantisus
Mantisus marked this pull request as ready for review November 9, 2026 23:38
@Mantisus
Mantisus requested a review from vdusek November 9, 2026 23:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant