pandora/pandora/event/tasks.py

23 lines
548 B
Python
Raw Normal View History

2011-10-09 15:57:12 +00:00
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
2011-10-27 11:06:13 +00:00
from celery.task import task
2011-10-09 15:57:12 +00:00
from .models import Event
2011-10-09 15:57:12 +00:00
'''
2011-10-27 11:06:13 +00:00
@periodic_task(run_every=crontab(hour=7, minute=30), queue='encoding')
def update_all_matches(**kwargs):
ids = [e['id'] for e in Event.objects.all().values('id')]
for i in ids:
e = Event.objects.get(pk=i)
e.update_matches()
'''
2012-03-21 08:13:38 +00:00
@task(ignore_results=True, queue='default')
2011-10-09 15:57:12 +00:00
def update_matches(eventId):
event = Event.objects.get(pk=eventId)
2011-10-09 15:57:12 +00:00
event.update_matches()