mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-19 23:35:04 +01:00
update pre-commit
This commit is contained in:
@@ -271,14 +271,14 @@ Every Alliance Auth installation will come with a couple of special celery relat
|
||||
|
||||
Celery-once is a celery extension "that allows you to prevent multiple execution and queuing of celery tasks". What that means is that you can ensure that only one instance of a celery task runs at any given time. This can be useful, for example, if you do not want multiple instances of your task to talk to the same external service at the same time.
|
||||
|
||||
We use a custom backend for celery_once in Alliance Auth defined [here](https://gitlab.com/allianceauth/allianceauth/-/blob/master/allianceauth/services/tasks.py#L14)
|
||||
We use a custom backend for celery_once in Alliance Auth defined [allianceauth.services.tasks.celery_once](https://gitlab.com/allianceauth/allianceauth/-/blob/master/allianceauth/services/tasks.py#L14)
|
||||
You can import it for use like so:
|
||||
|
||||
```python
|
||||
from allianceauth.services.tasks import QueueOnce
|
||||
```
|
||||
|
||||
An example of Alliance Auth's use within the `@sharedtask` decorator, can be seen [here](https://gitlab.com/allianceauth/allianceauth/-/blob/master/allianceauth/services/modules/discord/tasks.py#L62) in the discord module
|
||||
An example of Alliance Auth's use within the `@sharedtask` decorator, can be seen [allianceauth.services.modules.discord.tasks](https://gitlab.com/allianceauth/allianceauth/-/blob/master/allianceauth/services/modules/discord/tasks.py#L62) in the discord module
|
||||
You can use it like so:
|
||||
|
||||
```python
|
||||
|
||||
Reference in New Issue
Block a user