From: Leandro Lucarella Date: Mon, 19 Mar 2007 00:57:18 +0000 (+0000) Subject: Bugfix: las instancias de entrega a procesar deben haber vencido X-Git-Tag: 0_9_0~20 X-Git-Url: https://git.llucax.com/software/sercom.git/commitdiff_plain/8debedef54a312adcb3daef5ad6a3a7a9696018d Bugfix: las instancias de entrega a procesar deben haber vencido --- diff --git a/start-sercom.py b/start-sercom.py index 0ec9722..6a3235b 100644 --- a/start-sercom.py +++ b/start-sercom.py @@ -25,7 +25,7 @@ elif exists(join(dirname(__file__), "setup.py")): else: update_config(configfile="prod.cfg",modulename="sercom.config") -from sercom.model import InstanciaDeEntrega, hub +from sercom.model import InstanciaDeEntrega, Entrega, AND, hub from sercom.finalizer import Finalizer from threading import Thread from datetime import datetime @@ -42,7 +42,9 @@ class Queue(object): #{{{ try: hub.begin() try: - select = InstanciaDeEntrega.selectBy(inicio_proceso=None) + select = InstanciaDeEntrega.select(AND( + InstanciaDeEntrega.q.inicio_proceso == None, + InstanciaDeEntrega.q.fin <= datetime.now())) instancia = select.orderBy(InstanciaDeEntrega.q.fin)[0] instancia.inicio_proceso = datetime.now() finally: