From 54f4dff48780906ac1862246af984720cd329854 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 10 Aug 2010 12:19:52 +0200 Subject: [PATCH] only get posters that where just added --- oxdata/lookup/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oxdata/lookup/tasks.py b/oxdata/lookup/tasks.py index ec3f791..8f2a0a0 100644 --- a/oxdata/lookup/tasks.py +++ b/oxdata/lookup/tasks.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 -from datetime import timedelta +from datetime import timedelta, datetime from celery.decorators import task, periodic_task @@ -11,8 +11,9 @@ import poster.models @periodic_task(run_every=timedelta(days=1)) def cronjob(**kwargs): + before_import = datetime.now() cache.getIds() - for p in poster.models.PosterCache.objects.filter(image='', failed=False): + for p in poster.models.PosterCache.objects.filter(image='', failed=False, created__gt=before_import): p.get() @task(ignore_resulsts=True, queue='default')