add taskresults app to handle celery task results
This commit is contained in:
parent
9b4bef0050
commit
a336af46c2
11 changed files with 149 additions and 2 deletions
0
gnuviechadmin/taskresults/management/__init__.py
Normal file
0
gnuviechadmin/taskresults/management/__init__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
"""
|
||||
This module defines management commands for the taskresults app.
|
||||
|
||||
"""
|
|
@ -0,0 +1,20 @@
|
|||
"""
|
||||
This model contains the implementation of a management command to fetch the
|
||||
results of all `Celery <http://www.celeryproject.org/>`_ tasks that are not
|
||||
marked as finished yet.
|
||||
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from taskresults.models import TaskResult
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "fetch task results"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
for taskresult in TaskResult.objects.filter(finished=False):
|
||||
taskresult.fetch_result()
|
||||
taskresult.save()
|
Loading…
Add table
Add a link
Reference in a new issue