# HG changeset patch # User Sandro Knauß # Date 1288907220 -3600 # Node ID 5ca3aa8d75e169a63a5dfc050bc270a4ef931072 # Parent 642098115855fd609ae4aac5d767faf7ef9002f2 search for id in database diff -r 642098115855 -r 5ca3aa8d75e1 iro/acounting.py --- a/iro/acounting.py Thu Nov 04 22:00:21 2010 +0100 +++ b/iro/acounting.py Thu Nov 04 22:47:00 2010 +0100 @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- from database import Database +import logging +logger=logging.getLogger("iro.acounting"); class Acounting(Database): def __init__(self,id, connection): diff -r 642098115855 -r 5ca3aa8d75e1 iro/joblist.py --- a/iro/joblist.py Thu Nov 04 22:00:21 2010 +0100 +++ b/iro/joblist.py Thu Nov 04 22:47:00 2010 +0100 @@ -70,6 +70,10 @@ m.update(str(time.time())) m.update(os.urandom(10)) if not self.jobs.has_key(m.hexdigest): - self.jobs[m.hexdigest()]=None - break + if not self.dbconn: + self.jobs[m.hexdigest()]=None + break + if not self.manager.Acounting(m.hexdigest(),self.dbconn).getStatus(): + self.jobs[m.hexdigest()]=None + break return m.hexdigest() diff -r 642098115855 -r 5ca3aa8d75e1 iro/user.py --- a/iro/user.py Thu Nov 04 22:00:21 2010 +0100 +++ b/iro/user.py Thu Nov 04 22:47:00 2010 +0100 @@ -98,11 +98,10 @@ self.jobs[id]=self.jobqueue[id] return id - - def startMail(self, subject, body, recipients, frm, provider="default"): if not "mail" in self.features: raise NotSupportedFeature("mail") + logger.debug("startMail(%s,%s,%s,%s,%s)"%(subject, body, recipients, frm, provider)) id = self.jobqueue.newMail(subject, body, recipients, frm, provider) self.jobs[id]=self.jobqueue[id] return id