Basraah 17dd7c04c7 Replace django-celery with base Celery (#791)
Update celery tasks to new style & remove djcelery
Vanilla celery + django-celery-beat take over the role of djcelery. Task schedules are consolidated into settings instead of residing in code.
Update docs and example supervisor configs.
2017-05-03 16:53:16 -04:00

15 lines
288 B
Python

from corputils.models import CorpStats
from alliance_auth.celeryapp import app
@app.task
def update_corpstats(pk):
cs = CorpStats.objects.get(pk=pk)
cs.update()
@app.task
def update_all_corpstats():
for cs in CorpStats.objects.all():
update_corpstats.delay(cs.pk)