X-Git-Url: https://git.llucax.com/software/sercom.git/blobdiff_plain/8debedef54a312adcb3daef5ad6a3a7a9696018d..5e8e9e37d6f99ab10971bfb6eafe95c6d00f3088:/start-sercom.py diff --git a/start-sercom.py b/start-sercom.py index 6a3235b..fd1c7e2 100644 --- a/start-sercom.py +++ b/start-sercom.py @@ -46,6 +46,13 @@ class Queue(object): #{{{ InstanciaDeEntrega.q.inicio_proceso == None, InstanciaDeEntrega.q.fin <= datetime.now())) instancia = select.orderBy(InstanciaDeEntrega.q.fin)[0] + n = Entrega.selectBy(instancia=instancia, fin=None).count() + if n: + log.debug(_(u'Esperando para procesar instancia (%s), ' + 'faltan probar %s entregas'), instancia.shortrepr(), + n) + time.sleep(30) + continue instancia.inicio_proceso = datetime.now() finally: hub.commit() @@ -62,8 +69,8 @@ class Queue(object): #{{{ #}}} #q = Queue() -#finalizer = Finalizer(name='juanca', queue=q) -#t = Thread(name='juanca', target=finalizer.run) +#finalizer = Finalizer(name='finalizer', queue=q) +#t = Thread(name='finalizer', target=finalizer.run) #t.start() from sercom.controllers import Root