celery.beat

The periodic task scheduler.

celery.beat.EmbeddedService(app, max_interval=None, **kwargs)[исходный код]

Return embedded clock service.

Параметры:

thread (bool) – Run threaded instead of as a separate process. Uses multiprocessing by default, if available.

class celery.beat.PersistentScheduler(*args, **kwargs)[исходный код]

Scheduler backed by shelve database.

close()[исходный код]
get_schedule()[исходный код]
property info
known_suffixes = ('', '.db', '.dat', '.bak', '.dir')
persistence = <module 'shelve' from '/home/gruy/.pyenv/versions/3.10.4/lib/python3.10/shelve.py'>
property schedule
set_schedule(schedule)[исходный код]
setup_schedule()[исходный код]
sync()[исходный код]
class celery.beat.ScheduleEntry(name=None, task=None, last_run_at=None, total_run_count=None, schedule=None, args=(), kwargs=None, options=None, relative=False, app=None)[исходный код]

An entry in the scheduler.

Параметры:
args = None

Positional arguments to apply.

default_now()[исходный код]
editable_fields_equal(other)[исходный код]
is_due()[исходный код]

See is_due().

kwargs = None

Keyword arguments to apply.

last_run_at = None

The time and date of when this task was last scheduled.

name = None

The task name

next(last_run_at=None)

Return new instance, with date and count fields updated.

options = None

Task execution options.

schedule = None

The schedule (schedule)

total_run_count = 0

Total number of times this task has been scheduled.

update(other)[исходный код]

Update values from another entry.

Will only update «editable» fields:

task, schedule, args, kwargs, options.

class celery.beat.Scheduler(app, schedule=None, max_interval=None, Producer=None, lazy=False, sync_every_tasks=None, **kwargs)[исходный код]

Scheduler for periodic tasks.

The celery beat program may instantiate this class multiple times for introspection purposes, but then with the lazy argument set. It’s important for subclasses to be idempotent when this argument is set.

Параметры:
Entry

alias of ScheduleEntry

add(**kwargs)[исходный код]
adjust(n, drift=-0.01)[исходный код]
apply_async(entry, producer=None, advance=True, **kwargs)[исходный код]
apply_entry(entry, producer=None)[исходный код]
close()[исходный код]
property connection
get_schedule()[исходный код]
property info
install_default_entries(data)[исходный код]
is_due(entry)[исходный код]
logger = <Logger celery.beat (WARNING)>
max_interval = 300

Maximum time to sleep between re-checking the schedule.

merge_inplace(b)[исходный код]
populate_heap(event_t=<class 'celery.beat.event_t'>, heapify=<built-in function heapify>)[исходный код]

Populate the heap with the data contained in the schedule.

property producer
reserve(entry)[исходный код]
property schedule

The schedule dict/shelve.

schedules_equal(old_schedules, new_schedules)[исходный код]
send_task(*args, **kwargs)[исходный код]
set_schedule(schedule)[исходный код]
setup_schedule()[исходный код]
should_sync()[исходный код]
sync()[исходный код]
sync_every = 180

How often to sync the schedule (3 minutes by default)

sync_every_tasks = None

How many tasks can be called before a sync is forced.

tick(event_t=<class 'celery.beat.event_t'>, min=<built-in function min>, heappop=<built-in function heappop>, heappush=<built-in function heappush>)[исходный код]

Run a tick - one iteration of the scheduler.

Executes one due task per call.

Результат:

preferred delay in seconds for next call.

Тип результата:

float

update_from_dict(dict_)[исходный код]
exception celery.beat.SchedulingError[исходный код]

An error occurred while scheduling a task.

class celery.beat.Service(app, max_interval=None, schedule_filename=None, scheduler_cls=None)[исходный код]

Celery periodic task service.

get_scheduler(lazy=False, extension_namespace='celery.beat_schedulers')[исходный код]
property scheduler
scheduler_cls

alias of PersistentScheduler

start(embedded_process=False)[исходный код]
stop(wait=False)[исходный код]
sync()[исходный код]
Back to Top