mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-19 23:35:04 +01:00
more automated upgrades
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
To reduce redundancy and help speed up development we encourage developers to utilize the following packages when developing apps for Alliance Auth.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
discord_client
|
||||
@@ -13,4 +13,4 @@ eveonline
|
||||
notifications
|
||||
testutils
|
||||
utils
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -105,14 +105,13 @@ In this example we fist add 10 example tasks that need to run one after the othe
|
||||
|
||||
The list of task signatures is then converted to a chain and started asynchronously.
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
In our example we use ``si()``, which is a shortcut for "immutable signatures" and prevents us from having to deal with result sharing between tasks.
|
||||
|
||||
For more information on signature and work flows see the official documentation on `Canvas <https://docs.celeryproject.org/en/latest/userguide/canvas.html>`_.
|
||||
|
||||
In this context please note that Alliance Auth currently only supports chaining, because all other variants require a so called results back, which Alliance Auth does not have.
|
||||
```
|
||||
:::
|
||||
|
||||
## How can I define periodic tasks for my app?
|
||||
|
||||
@@ -149,18 +148,14 @@ In Alliance Auth we have defined task priorities from 0 - 9 as follows:
|
||||
====== ========= ===========
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. warning::
|
||||
:::{warning}
|
||||
Please make sure to use task priorities with care and especially do not use higher priorities without a good reason. All apps including Alliance Auth share the same task queues, so using higher task priorities excessively can potentially prevent more important tasks (of other apps) from completing on time.
|
||||
|
||||
You also want to make sure to run use lower priorities if you have a large amount of tasks or long running tasks, which are not super urgent. (e.g. the regular update of all Eve characters from ESI runs with priority 7)
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::
|
||||
:::{hint}
|
||||
If no priority is specified all tasks will be started with the default priority, which is 5.
|
||||
```
|
||||
|
||||
:::
|
||||
To run a task with a different priority you need to specify it when starting it.
|
||||
|
||||
Example for starting a task with priority 3:
|
||||
@@ -169,10 +164,9 @@ Example for starting a task with priority 3:
|
||||
example.apply_async(priority=3)
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
For defining a priority to tasks you can not use the convenient shortcut ``delay()``, but instead need to start a task with ``apply_async()``, which also requires you to pass parameters to your task function differently. Please check out the `official docs <https://docs.celeryproject.org/en/stable/reference/celery.app.task.html#celery.app.task.Task.apply_async>`_ for details.
|
||||
```
|
||||
:::
|
||||
|
||||
## What special features should I be aware of?
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
In this section you find topics useful for app developers.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
api/index
|
||||
celery
|
||||
core_models
|
||||
templatetags
|
||||
```
|
||||
:::
|
||||
|
||||
Reference in New Issue
Block a user