Change celery tasks to shared task decorator

This commit is contained in:
Basraah
2017-12-11 00:26:07 +10:00
parent 676e68a2bb
commit f037d7fea6
14 changed files with 46 additions and 43 deletions

View File

@@ -1,14 +1,14 @@
from allianceauth.celery import app
from celery import shared_task
from allianceauth.corputils import CorpStats
@app.task
@shared_task
def update_corpstats(pk):
cs = CorpStats.objects.get(pk=pk)
cs.update()
@app.task
@shared_task
def update_all_corpstats():
for cs in CorpStats.objects.all():
update_corpstats.delay(cs.pk)