mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 04:20:17 +02:00
Merge branch 'master' into 'master'
Celery documentation improvements See merge request allianceauth/allianceauth!1663
This commit is contained in:
commit
d639617eba
@ -40,10 +40,10 @@ Please use the following approach to ensure your tasks are working properly with
|
||||
Here is an example implementation of a task:
|
||||
|
||||
```python
|
||||
import logging
|
||||
from allianceauth.services.hooks import get_extension_logger
|
||||
from celery import shared_task
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = get_extension_logger(__name__)
|
||||
|
||||
|
||||
@shared_task
|
||||
@ -80,10 +80,10 @@ However, many long-running tasks consist of several smaller processes that need
|
||||
Example implementation for a celery chain:
|
||||
|
||||
```python
|
||||
import logging
|
||||
from allianceauth.services.hooks import get_extension_logger
|
||||
from celery import shared_task, chain
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = get_extension_logger(__name__)
|
||||
|
||||
|
||||
@shared_task
|
||||
@ -96,7 +96,7 @@ def long_runner():
|
||||
my_tasks = list()
|
||||
for _ in range(10):
|
||||
task_signature = example.si()
|
||||
my_task.append(task_signature)
|
||||
my_tasks.append(task_signature)
|
||||
|
||||
chain(my_tasks).delay()
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user