deseasion.backend.tasks package

class deseasion.backend.tasks.ContextTask

Bases: Task

app_context = <flask.ctx.AppContext object>
ignore_result = False

If enabled the worker won’t store task state and return values for this task. Defaults to the :setting:`task_ignore_result` setting.

priority = None

Default task priority.

rate_limit = None

Rate limit for this task type. Examples: None (no rate limit), ‘100/s’ (hundred tasks a second), ‘100/m’ (hundred tasks a minute),`’100/h’` (hundred tasks an hour)

reject_on_worker_lost = None

Even if acks_late is enabled, the worker will acknowledge tasks when the worker process executing them abruptly exits or is signaled (e.g., :sig:`KILL`/:sig:`INT`, etc).

Setting this to true allows the message to be re-queued instead, so that the task will execute again by the same worker, or another worker.

Warning: Enabling this can cause message loops; make sure you know what you’re doing.

request_stack = <celery.utils.threads._LocalStack object>

Task request stack, the current request will be the topmost.

serializer = 'json'

The name of a serializer that are registered with kombu.serialization.registry. Default is ‘json’.

store_errors_even_if_ignored = False

When enabled errors will be stored even if the task is otherwise configured to ignore results.

track_started = False

If enabled the task will report its status as ‘started’ when the task is executed by a worker. Disabled by default as the normal behavior is to not report that level of granularity. Tasks are either pending, finished, or waiting to be retried.

Having a ‘started’ status can be useful for when there are long running tasks and there’s a need to report what task is currently running.

The application default can be overridden using the :setting:`task_track_started` setting.

typing = True

Enable argument checking. You can set this to false if you don’t want the signature to be checked when calling the task. Defaults to app.strict_typing.

class deseasion.backend.tasks.ProgressFeedback(task)

Bases: object

forget_message()
set_message(message)
set_progress(count, total)
deseasion.backend.tasks.project_task_failure(task_id, exception, args, kwargs, traceback, einfo, **kw)

Save the ‘FAILED’ state and the error message when a task fails

deseasion.backend.tasks.project_task_postrun(task_id, task, args, kwargs, retval, state, **kw)

Postrun signal for the tasks

If the task name is ‘process_project_data’, the final status and finish time is saved to the database.

deseasion.backend.tasks.project_task_prerun(task_id, task, args, kwargs, **kw)

Prerun signal for the tasks.

deseasion.backend.tasks.project_task_revoked(request, terminated, signum, expired, **wk)

Save the ‘REVOKED’ state and the time when a task is revoked