mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
Adds cron to docs
This commit is contained in:
@@ -45,6 +45,13 @@ You can manage them through the :ref:`admin_page` or directly from your code wit
|
||||
repeats=24,
|
||||
next_run=arrow.utcnow().replace(hour=18, minute=0))
|
||||
|
||||
# Use a cron expression
|
||||
schedule('math.hypot',
|
||||
3, 4,
|
||||
schedule_type=Schedule.CRON,
|
||||
cron = '0 22 * * 1-5')
|
||||
|
||||
|
||||
|
||||
Missed schedules
|
||||
----------------
|
||||
@@ -99,8 +106,9 @@ Reference
|
||||
:param args: arguments for the scheduled function.
|
||||
:param str name: An optional name for your schedule.
|
||||
:param str hook: optional result hook function. Dotted strings only.
|
||||
:param str schedule_type: (O)nce, M(I)nutes, (H)ourly, (D)aily, (W)eekly, (M)onthly, (Q)uarterly, (Y)early or :attr:`Schedule.TYPE`
|
||||
:param str schedule_type: (O)nce, M(I)nutes, (H)ourly, (D)aily, (W)eekly, (M)onthly, (Q)uarterly, (Y)early or (C)ron :attr:`Schedule.TYPE`
|
||||
:param int minutes: Number of minutes for the Minutes type.
|
||||
:param str cron: Cron expression for the Cron type.
|
||||
:param int repeats: Number of times to repeat schedule. -1=Always, 0=Never, n =n.
|
||||
:param datetime next_run: Next or first scheduled execution datetime.
|
||||
:param dict q_options: options passed to async_task for this schedule
|
||||
@@ -140,7 +148,7 @@ Reference
|
||||
|
||||
.. py:attribute:: TYPE
|
||||
|
||||
:attr:`ONCE`, :attr:`MINUTES`, :attr:`HOURLY`, :attr:`DAILY`, :attr:`WEEKLY`, :attr:`MONTHLY`, :attr:`QUARTERLY`, :attr:`YEARLY`
|
||||
:attr:`ONCE`, :attr:`MINUTES`, :attr:`HOURLY`, :attr:`DAILY`, :attr:`WEEKLY`, :attr:`MONTHLY`, :attr:`QUARTERLY`, :attr:`YEARLY`, :attr:`CRON`
|
||||
|
||||
|
||||
.. py:attribute:: minutes
|
||||
@@ -148,6 +156,10 @@ Reference
|
||||
The number of minutes the :attr:`MINUTES` schedule should use.
|
||||
Is ignored for other schedule types.
|
||||
|
||||
.. py:attribute:: cron
|
||||
|
||||
A cron string describing the schedule. You need the optional `croniter` package installed for this.
|
||||
|
||||
.. py:attribute:: repeats
|
||||
|
||||
Number of times to repeat the schedule. -1=Always, 0=Never, n =n.
|
||||
@@ -208,3 +220,9 @@ Reference
|
||||
|
||||
`'Y'` only runs once a year. The same caution as with months apply;
|
||||
If you set this to february 29th, it will run on february 28th in the following years.
|
||||
|
||||
.. py:attribute:: CRON
|
||||
|
||||
`'C'` uses the optional `croniter` package to determine a schedule based a cron expression.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user