Skip to main content
Version: Next

InitOptions

Hierarchy

Index

Properties

optionalgracefulShutdown

gracefulShutdown?: boolean = true

Whether to automatically handle platform shutdown signals. When enabled, Actor.exit() is called on aborting events and Actor.reboot() on migrating events.

optionalgracefulShutdownDelayMillis

gracefulShutdownDelayMillis?: number = 0

Delay in milliseconds before calling Actor.exit()/Actor.reboot() on aborting/migrating events. Since both methods already wait for all event handlers to complete, this delay is usually unnecessary.

optionalrequestQueueAccess

Determines how request queues opened on the Apify platform are consumed.

  • 'single' (default) assumes this run is the only consumer of its request queues. Requests are not locked server-side and the queue head is estimated locally, which means fewer (paid) API calls and better performance.
  • 'shared' locks every fetched request server-side, so any number of concurrent consumers (e.g. several Actor runs) can safely process the same queue, at the cost of roughly one extra API call per processed request.

Only applies on the Apify platform (or with forceCloud); local storage ignores it.

optionalstorage

storage?: StorageBackend

Storage backend to use, in place of the Apify platform storage (on the platform) or crawlee's local storage (outside of it).

Items pushed to the default dataset are then not charged for under the pay-per-event pricing model: the platform counts an apify-default-dataset-item per item it stores itself, and a backend of your own stores them elsewhere.