StateDB
Bootstep that sets up between-restart state database file.
Attributes
| Attribute | Type | Description |
|---|---|---|
| enabled | bool | Flag indicating whether the state database persistence is active, determined by the worker's statedb configuration. |
Constructor
Signature
def StateDB(
w: [Worker](../../events/state/worker.md?sid=celery_events_state_worker),
**kwargs: dict
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| w | [Worker](../../events/state/worker.md?sid=celery_events_state_worker) | The worker instance associated with this bootstep. |
| **kwargs | dict | Additional keyword arguments passed to the parent class constructor. |
Signature
def StateDB(
w: celery.worker.Worker,
**kwargs: dict
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| w | celery.worker.Worker | The worker instance this bootstep is being attached to. |
| **kwargs | dict | Additional configuration arguments passed to the parent Step class. |
Methods
create()
@classmethod
def create(
w: celery.worker.Worker
) - > null
Instantiates the persistent state storage for the worker and registers an exit handler to ensure state is saved to disk upon shutdown.
Parameters
| Name | Type | Description |
|---|---|---|
| w | celery.worker.Worker | The worker instance for which the persistent state database is being created. |
Returns
| Type | Description |
|---|---|
null | None |