celery.beat

celery.beat

The periodic task scheduler.

exception celery.beat.SchedulingError[源代码]

An error occured while scheduling a task.

class celery.beat.ScheduleEntry(name=None, task=None, last_run_at=None, total_run_count=None, schedule=None, args=(), kwargs={}, options={}, relative=False, app=None)[源代码]

An entry in the scheduler.

参数:
  • args = None

    Positional arguments to apply.

  • 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 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).

class celery.beat.Scheduler(app, schedule=None, max_interval=None, Publisher=None, lazy=False, \*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 is important for subclasses to be idempotent when this argument is set.

参数:

class celery.beat.PersistentScheduler(\args, **kwargs*)[源代码]

class celery.beat.Service(app, max_interval=None, schedule_filename=None, scheduler_cls=None)[源代码]

celery.beat.EmbeddedService(\args, **kwargs*)[源代码]

Return embedded clock service.

参数:thread – Run threaded instead of as a separate process. Uses multiprocessing by default, if available.