bzr revid: stephane@tinyerp.com-20090206152434-et0i5107w5mdgada
This commit is contained in:
Stephane Wirtel
2009-02-06 16:24:34 +01:00
2 changed files with 13 additions and 10 deletions
+9 -6
View File
@@ -75,15 +75,18 @@ class ir_cron(osv.osv, netsvc.Agent):
f(cr, uid, *args)
def _poolJobs(self, db_name, check=False):
if self.pool._init:
self.setAlarm(self._poolJobs, int(time.time())+10*60, [db_name])
try:
db, pool = pooler.get_db_and_pool(db_name)
if pool._init:
# retry in a few minutes
self.setAlarm(self._poolJobs, int(time.time())+10*60, [db_name])
cr = db.cursor()
except:
return False
now = DateTime.now()
#FIXME: multidb. Solution: a l'instanciation d'une nouvelle connection bd (ds pooler) fo que j'instancie
# un nouveau pooljob avec comme parametre la bd
try:
cr = pooler.get_db(db_name).cursor()
except:
return False
try:
cr.execute('select * from ir_cron where numbercall<>0 and active and nextcall<=now() order by priority')
+4 -4
View File
@@ -26,10 +26,10 @@ class RemoteContractException(Exception): pass
class remote_contract(object):
def __init__(self, contract_id, contract_password, modules=None):
self.__server = 'http://192.168.0.127:8072/xmlrpc/'
self.__db = "maintenance"
self.__password = "admin"
self.__login = "admin"
self.__server = 'http://terp.tinyerp.com:8069/xmlrpc/'
self.__db = "tiny"
self.__password = "maintenance"
self.__login = "maintenance"
rpc = xmlrpclib.ServerProxy(self.__server + 'common')
try: