Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

chore: add aborting event to events docs [skip ci]

Ondra Urbanc89f532f2ba0
diff --git a/src/events.js b/src/events.js
index dcfd46572..162fec8f0 100644
--- a/src/events.js
+++ b/src/events.js
@@ -50,6 +50,10 @@ let persistStateInterval = null;
* Emitted when the actor running on the Apify platform is going to be migrated to another worker server soon.
* You can use it to persist the state of the actor and abort the run, to speed up migration.
* For example, this is used by the {@link RequestList} class.
+ * - `aborting`: `void`
+ * When a user aborts an actor run on the Apify platform, they can choose to abort gracefully to allow
+ * the actor some time before getting killed. This graceful abort emits the `aborting` event which the SDK
+ * uses to gracefully stop running crawls and you can use it to do your own cleanup as well.
* - `persistState`: `{ "isMigrating": Boolean }`
* Emitted in regular intervals (by default 60 seconds) to notify all components of Apify SDK that it is time to persist
* their state, in order to avoid repeating all work when the actor restarts.