Page MenuHome

tasks.py
No OneTemporary

tasks.py

import logging
import typing
from .celery_cfg import celery_cfg
log = logging.getLogger(__name__)
@celery_cfg.task(track_started=True)
def long_task(numbers: typing.List[int]):
_log = log.getChild('long_task')
_log.info('Computing sum of %i items', len(numbers))
import time
time.sleep(6)
thesum = sum(numbers)
_log.info('Computed sum of %i items', len(numbers))
return thesum

File Metadata

Mime Type
text/x-python
Expires
Sat, Jul 2, 9:51 PM (2 d)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2a/50/7b0f9c813ea4d7a92ff007bb51a8

Event Timeline