mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-28 17:28:11 +08:00
Schedules of type ONCE will now self destruct with negative repeats or just deactivated with positive repeats
This commit is contained in:
+3
-1
@@ -41,12 +41,14 @@ In this case you would set the schedule type to :attr:`Schedule.HOURLY` and the
|
||||
|
||||
When you set repeats to `-1` the schedule will continue indefinitely and the repeats will still count down. This can be used as an indicator of how many times the schedule has been executed.
|
||||
|
||||
An exception to this are schedules of type :attr:`Schedule.ONCE`. Repeats are ignored by this schedule type and it will always reset it zero after execution.
|
||||
An exception to this are schedules of type :attr:`Schedule.ONCE`. Negative repeats for this schedule type will cause it to be deleted from the database.
|
||||
This behavior is useful if you have many delayed actions which you do not necessarily need a result for. A positive number will keep the ONCE schedule, but it will not run again.
|
||||
|
||||
.. note::
|
||||
|
||||
To run a `Once` schedule again, change the repeats to something other than `0`. Set a new run time before you do this or let it execute immediately.
|
||||
|
||||
|
||||
Next run
|
||||
~~~~~~~~
|
||||
|
||||
|
||||
+3
-1
@@ -116,7 +116,9 @@ Reference
|
||||
|
||||
.. py:attribute:: ONCE
|
||||
|
||||
`'O'` the schedule will only run once. Repeats are ignored and set to `0` after execution.
|
||||
`'O'` the schedule will only run once.
|
||||
If it has a negative :attr:`repeats` it will be deleted after it has run.
|
||||
If you want to keep the result, set :attr:`repeats` to a positive number.
|
||||
|
||||
.. py:attribute:: HOURLY
|
||||
|
||||
|
||||
Reference in New Issue
Block a user