mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
* added default module django_q * set build mode to nit-picky * warnings raise errors Want to make sure the docs are neat and build on Travis , to make it easier to accept doc pull requests
75 lines
2.6 KiB
ReStructuredText
75 lines
2.6 KiB
ReStructuredText
.. _admin_page:
|
|
.. py:currentmodule:: django_q
|
|
|
|
Admin pages
|
|
===========
|
|
|
|
Django Q does not use custom HTML pages, but instead uses what is offered by Django's model admin by default.
|
|
When you open Django Q's admin pages you will see three models:
|
|
|
|
Successful tasks
|
|
----------------
|
|
|
|
Shows all successfully executed tasks. Meaning they did not encounter any errors during execution.
|
|
From here you can look at details of each task or delete them.
|
|
|
|
Uses the :class:`Success` proxy model.
|
|
|
|
.. tip::
|
|
|
|
The maximum number of successful tasks can be set using the :ref:`save_limit` option.
|
|
|
|
|
|
|
|
Failed tasks
|
|
------------
|
|
Failed tasks have encountered an error, preventing them from finishing execution.
|
|
The worker will try to put the error in the `result` field of the task so you can review what happened.
|
|
|
|
You can resubmit a failed task back to the queue using the admins action menu.
|
|
|
|
Uses the :class:`Failure` proxy model
|
|
|
|
Scheduled tasks
|
|
---------------
|
|
|
|
Here you can check on the status of your scheduled tasks, create, edit or delete them.
|
|
|
|
Repeats
|
|
~~~~~~~
|
|
If you want a schedule to only run a finite amount of times, e.g. every hour for the next 24 hours, you can do that using the :attr:`Schedule.repeats` attribute.
|
|
In this case you would set the schedule type to :attr:`Schedule.HOURLY` and the repeats to `24`. Every time the schedule runs the repeats count down until it hits zero and schedule is no longer run.
|
|
|
|
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`. 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
|
|
~~~~~~~~
|
|
|
|
Shows you when this task will be added to the queue next.
|
|
|
|
|
|
Last run
|
|
~~~~~~~~
|
|
|
|
Links to the task result of the last scheduled run. Shows nothing if the schedule hasn't run yet or if task result has been deleted.
|
|
|
|
Success
|
|
~~~~~~~
|
|
|
|
Indicates the success status of the last scheduled task, if any.
|
|
|
|
.. note::
|
|
|
|
if you have set the :ref:`save_limit` configuration option to not save successful tasks to the database, you will only see the failed results of your schedules.
|
|
|
|
|
|
Uses the :class:`Schedule` model
|