Skip to main content
Version: Next

MainOptions

Hierarchy

Index

Properties

optionalinheritedexit

exit?: boolean

Call process.exit()? Defaults to true

optionalinheritedexitCode

exitCode?: number

Exit code, defaults to 0

optionalinheritedgracefulShutdown

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.

optionalinheritedgracefulShutdownDelayMillis

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.

optionalinheritedrequestQueueAccess

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.

optionalinheritedstatusMessage

statusMessage?: string

Exit with given status message

optionalinheritedstorage

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.

optionalinheritedtimeoutSecs

timeoutSecs?: number = 30

Amount of time, in seconds, to wait for all event handlers to finish before exiting the process.