ApifyFileSystemStorageBackend
Hierarchy
- FileSystemStorageBackend
- ApifyFileSystemStorageBackend
Index
Constructors
constructor
Parameters
options: ApifyFileSystemStorageOptions
Returns ApifyFileSystemStorageBackend
Methods
externalinheritedcreateDatasetBackend
Create (or open) a dataset backend. If
idis provided, opens the dataset with that ID. Ifnameis provided, opens an existing dataset with that name or creates a new one. If neither is provided, opens or creates the default dataset.Parameters
externaloptionaloptions: StorageIdentifier
Returns Promise<DatasetBackend<Dictionary>>
externalinheritedcreateKeyValueStoreBackend
Create (or open) a key-value store backend. If
idis provided, opens the key-value store with that ID. Ifnameis provided, opens an existing store with that name or creates a new one. If neither is provided, opens or creates the default key-value store.Parameters
externaloptionaloptions: StorageIdentifier
Returns Promise<KeyValueStoreBackend>
externalinheritedcreateRequestQueueBackend
Create (or open) a request queue backend. If
idis provided, opens the request queue with that ID. Ifnameis provided, opens an existing queue with that name or creates a new one. If neither is provided, opens or creates the default request queue.Parameters
externaloptionaloptions: StorageIdentifier
Returns Promise<RequestQueueBackend>
externalinheritedgetStorageBackendCacheKey
Return a cache key that includes the resolved storage directory, so that two
FileSystemStorageBackendinstances pointing at different directories get separate cache partitions, by including the storage directory in the cache key.Returns string
externalinheritedpurge
Cleans up the run-scoped storages before the run starts, sweeping the storage directories so that leftovers from a previous process are caught too.
Returns Promise<void>
externalinheritedstorageExists
Check whether a storage with the given ID exists.
Used internally to resolve ambiguous
idOrNamestrings passed toDataset.open(),KeyValueStore.open(), andRequestQueue.open().Parameters
externalid: string
externaltype: Dataset | KeyValueStore | RequestQueue
Returns Promise<boolean>
externalinheritedteardown
This method should be called at the end of the process, to ensure all data is saved.
It persists the state of every opened request queue so that requests fetched but not yet handled are not stuck (until their lock expires) for the next consumer of the same on-disk queue.
Returns Promise<void>
Crawlee's file-system storage backend, aware of the Actor input.
Locally the input arrives in the default key-value store as a bare
INPUTorINPUT.jsonfile with no metadata sidecar — written by the Apify CLI, a project template, or by hand. This backend adopts such a file as the record under the input key when the store is opened (both files present fails the open), and keeps the input keys when the default store is purged on start. Everything else is inherited from FileSystemStorageBackend.Actorinstalls it as the local backend; pass an instance toActor.init({ storage })only if you need to construct it yourself.