This document describes Celery 2.4. For development docs, go here.
celery.beat¶
celery.beat¶
The Celery periodic task scheduler.
copyright: |
|
---|---|
license: | BSD, see LICENSE for more details. |
-
celery.beat.
EmbeddedService
(*args, **kwargs)¶ Return embedded clock service.
Parameters: thread – Run threaded instead of as a separate process. Default is False
.
-
class
celery.beat.
PersistentScheduler
(*args, **kwargs)¶ -
close
()¶
-
get_schedule
()¶
-
info
¶
-
persistence
= <module 'shelve' from '/usr/lib/python2.7/shelve.pyc'>¶
-
setup_schedule
()¶
-
sync
()¶
-
-
class
celery.beat.
ScheduleEntry
(name=None, task=None, last_run_at=None, total_run_count=None, schedule=None, args=(), kwargs={}, options={}, relative=False)¶ An entry in the scheduler.
Parameters: - name – see
name
. - schedule – see
schedule
. - args – see
args
. - kwargs – see
kwargs
. - options – see
options
. - last_run_at – see
last_run_at
. - total_run_count – see
total_run_count
. - relative – Is the time relative to when the server starts?
-
args
= None¶ Positional arguments to apply.
-
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)¶ Returns a new instance of the same class, but with its date and count fields updated.
-
options
= None¶ Task execution options.
-
schedule
= None¶ The schedule (run_every/crontab)
-
total_run_count
= 0¶ Total number of times this task has been scheduled.
-
update
(other)¶ Update values from another entry.
Does only update “editable” fields (task, schedule, args, kwargs, options).
- name – see
-
class
celery.beat.
Scheduler
(schedule=None, logger=None, max_interval=None, app=None, Publisher=None, lazy=False, **kwargs)¶ Scheduler for periodic tasks.
Parameters: - schedule – see
schedule
. - logger – see
logger
. - max_interval – see
max_interval
.
-
Entry
¶ alias of
ScheduleEntry
-
add
(**kwargs)¶
-
apply_async
(entry, publisher=None, **kwargs)¶
-
close
()¶
-
connection
¶
-
get_schedule
()¶
-
info
¶
-
install_default_entries
(data)¶
-
logger
= None¶ Current logger.
-
max_interval
= 1¶ Maximum time to sleep between re-checking the schedule.
-
maybe_due
(entry, publisher=None)¶
-
merge_inplace
(b)¶
-
publisher
¶
-
reserve
(entry)¶
-
schedule
¶ The schedule dict/shelve.
-
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)
-
tick
()¶ Run a tick, that is one iteration of the scheduler.
Executes all due tasks.
-
update_from_dict
(dict_)¶
- schedule – see
-
exception
celery.beat.
SchedulingError
¶ An error occured while scheduling a task.