Merge branch 'master' into 'master'

Celery documentation improvements

See merge request allianceauth/allianceauth!1663
This commit is contained in:
Ariel Rin 2024-11-17 01:57:05 +00:00
commit d639617eba

View File

@ -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()
```