mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: fix tools.py
This commit is contained in:
parent
be95c8b364
commit
7bbd1271c6
@ -59,10 +59,9 @@ class RunbotClient():
|
|||||||
try:
|
try:
|
||||||
self.host.last_start_loop = fields.Datetime.now()
|
self.host.last_start_loop = fields.Datetime.now()
|
||||||
self.env.cr.commit()
|
self.env.cr.commit()
|
||||||
if self.env.registry != self.pool.check_signaling():
|
if self.env.registry != self.env.registry.check_signaling():
|
||||||
# the registry has changed, reload self in the new registry
|
|
||||||
self.env.reset()
|
self.env.reset()
|
||||||
self.env = self.env() #not sure
|
self.env = self.env()
|
||||||
self.count = self.count % self.max_count
|
self.count = self.count % self.max_count
|
||||||
if self.host.paused:
|
if self.host.paused:
|
||||||
sleep_time = 5
|
sleep_time = 5
|
||||||
@ -156,16 +155,15 @@ def run(client_class):
|
|||||||
|
|
||||||
# create environment
|
# create environment
|
||||||
registry = odoo.registry(args.database)
|
registry = odoo.registry(args.database)
|
||||||
with odoo.api.Environment.manage():
|
try:
|
||||||
with registry.cursor() as cr:
|
with registry.cursor() as cr:
|
||||||
env = odoo.api.Environment(cr, odoo.SUPERUSER_ID, {})
|
env = odoo.api.Environment(cr, odoo.SUPERUSER_ID, {})
|
||||||
client = client_class(env)
|
client = client_class(env)
|
||||||
# run main loop
|
# run main loop
|
||||||
try:
|
client.main_loop()
|
||||||
client.main_loop()
|
except Exception as e:
|
||||||
except Exception as e:
|
_logger.exception(str(e))
|
||||||
_logger.exception(str(e))
|
raise e
|
||||||
raise e
|
|
||||||
_logger.info("Stopping gracefully")
|
_logger.info("Stopping gracefully")
|
||||||
|
|
||||||
def human_size(nb):
|
def human_size(nb):
|
||||||
|
Loading…
Reference in New Issue
Block a user