Page MenuHome

tasks.py
No OneTemporary

tasks.py

import logging
import typing
from pillar import current_app
log = logging.getLogger(__name__)
@current_app.celery.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
Mon, Nov 2, 12:12 AM (1 d, 23 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
77/ec/5d91f0398e712d2535e21c089287

Event Timeline