mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-09 04:48:13 +08:00
docs: expanded schedule example
This commit is contained in:
+5
-5
@@ -162,11 +162,11 @@ Admin page or directly from your code:
|
|||||||
import arrow
|
import arrow
|
||||||
|
|
||||||
schedule('math.hypot',
|
schedule('math.hypot',
|
||||||
3, 4,
|
3, 4,
|
||||||
schedule_type=Schedule.MINUTES,
|
schedule_type=Schedule.MINUTES,
|
||||||
minutes = 5,
|
minutes=5,
|
||||||
repeats= 24,
|
repeats=24,
|
||||||
next_run = arrow.utcnow().replace(hour=18, minute=0))
|
next_run=arrow.utcnow().replace(hour=18, minute=0))
|
||||||
|
|
||||||
For more info check the `Schedules <http://django-q.readthedocs.org/en/latest/schedules.html>`__ documentation.
|
For more info check the `Schedules <http://django-q.readthedocs.org/en/latest/schedules.html>`__ documentation.
|
||||||
|
|
||||||
|
|||||||
+7
-5
@@ -32,14 +32,16 @@ You can manage them through the :ref:`admin_page` or directly from your code wit
|
|||||||
q_options={'timeout': 30},
|
q_options={'timeout': 30},
|
||||||
schedule_type=Schedule.HOURLY)
|
schedule_type=Schedule.HOURLY)
|
||||||
|
|
||||||
# Run a schedule every 5 minutes, starting at 6.
|
# Run a schedule every 5 minutes, starting at 6 today
|
||||||
|
# for 2 hours
|
||||||
import arrow
|
import arrow
|
||||||
|
|
||||||
schedule('math.hypot',
|
schedule('math.hypot',
|
||||||
3, 4,
|
3, 4,
|
||||||
schedule_type=Schedule.MINUTES,
|
schedule_type=Schedule.MINUTES,
|
||||||
minutes = 5,
|
minutes=5,
|
||||||
next_run = arrow.utcnow().replace(hour=18, minute=0))
|
repeats=24,
|
||||||
|
next_run=arrow.utcnow().replace(hour=18, minute=0))
|
||||||
|
|
||||||
Management Commands
|
Management Commands
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user