From 8debedef54a312adcb3daef5ad6a3a7a9696018d Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 19 Mar 2007 00:57:18 +0000 Subject: [PATCH 1/1] Bugfix: las instancias de entrega a procesar deben haber vencido --- start-sercom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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: -- 2.43.0