Skip to content

Commit 5372a66

Browse files
committed
docs: remove Crawlee references from graceful shutdown docs
This is a pure SDK feature - the framing about "with/without Crawlee crawlers" was incorrect and confusing. https://claude.ai/code/session_017U4px7vy75ioiTaC5teCaV
1 parent 3caa4fb commit 5372a66

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

docs/02_concepts/01_actor_lifecycle.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,7 @@ When running on the Apify platform, your Actor may receive signals to shut down
159159
- A user aborts the Actor run with the "abort gracefully" option (`aborting` event) — the Actor should save its state and exit
160160
- The platform needs to migrate your Actor to a different server (`migrating` event) — the Actor should save its state and reboot so the run continues on a new worker
161161

162-
### With Crawlee crawlers
163-
164-
If you're using Crawlee crawlers (like `CheerioCrawler`, `PlaywrightCrawler`, etc.), graceful shutdown is handled automatically. The crawler listens for these events and stops accepting new requests while finishing the ones in progress.
165-
166-
### Without Crawlee crawlers
167-
168-
If your Actor doesn't use Crawlee crawlers but still needs to respond to platform shutdown signals, you can enable automatic graceful shutdown by passing `gracefulShutdown: true` to `Actor.init()`:
162+
You can enable automatic handling of these events by passing `gracefulShutdown: true` to `Actor.init()`:
169163

170164
```js
171165
import { Actor } from 'apify';
@@ -181,9 +175,11 @@ await Actor.exit();
181175

182176
When `gracefulShutdown` is enabled:
183177

184-
- On `aborting`, the SDK calls `Actor.exit()`, which waits for all event handlers to complete before exiting. You can register cleanup handlers via the `exit` event.
178+
- On `aborting`, the SDK calls `Actor.exit()`, which waits for all event handlers to complete before exiting.
185179
- On `migrating`, the SDK calls `Actor.reboot()`, which also waits for all event handlers to complete, then restarts the Actor on a new worker so the run can continue.
186180

181+
You can register cleanup handlers via the `persistState` event to save state before shutdown:
182+
187183
```js
188184
import { Actor } from 'apify';
189185

0 commit comments

Comments
 (0)