forked from 0x2620/pandora
rebuild place/event matches once a day, this gets out of sync if new annotations are added
This commit is contained in:
parent
e24a59fb70
commit
16d6c2c0fe
2 changed files with 14 additions and 0 deletions
|
@ -7,6 +7,13 @@ from celery.decorators import task, periodic_task
|
|||
import models
|
||||
|
||||
|
||||
@periodic_task(run_every=timedelta(days=1), queue='encoding')
|
||||
def update_all_matches(**kwargs):
|
||||
ids = [e['id'] for e in models.Event.objects.all().values('id')]
|
||||
for i in ids:
|
||||
e = models.Event.objects.get(pk=i)
|
||||
e.update_matches()
|
||||
|
||||
@task(ignore_resulsts=True, queue='default')
|
||||
def update_matches(eventId):
|
||||
event = models.Event.objects.get(pk=eventId)
|
||||
|
|
|
@ -7,6 +7,13 @@ from celery.decorators import task, periodic_task
|
|||
import models
|
||||
|
||||
|
||||
@periodic_task(run_every=timedelta(days=1), queue='encoding')
|
||||
def update_all_matches(**kwargs):
|
||||
ids = [p['id'] for p in models.Place.objects.all().values('id')]
|
||||
for i in ids:
|
||||
p = models.Place.objects.get(pk=i)
|
||||
p.update_matches()
|
||||
|
||||
@task(ignore_resulsts=True, queue='default')
|
||||
def update_matches(id):
|
||||
place = models.Place.objects.get(pk=id)
|
||||
|
|
Loading…
Reference in a new issue