summaryrefslogtreecommitdiff
path: root/odoo/netsvc.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-06-20 12:04:52 +0200
committerChristophe Simonis <chs@odoo.com>2019-06-20 12:04:52 +0200
commita7ad19d7fd5b4dd1dec4f28e222bfa3854ee24db (patch)
tree526cd26144123e22be9de766a72c9e87ee4d7008 /odoo/netsvc.py
parent249d09068aebc187bc510f97524baddc3f5cc6cb (diff)
parentc5c955db7acd94ae4682a1e5040320806ca22056 (diff)
[MERGE] forward port branch 10.0 up to c5c955db7ac
Diffstat (limited to 'odoo/netsvc.py')
-rw-r--r--odoo/netsvc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/odoo/netsvc.py b/odoo/netsvc.py
index 0c64ebe51aa..7b9525747ba 100644
--- a/odoo/netsvc.py
+++ b/odoo/netsvc.py
@@ -48,7 +48,7 @@ def LocalService(name):
path_prefix = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
class PostgreSQLHandler(logging.Handler):
- """ PostgreSQL Loggin Handler will store logs in the database, by default
+ """ PostgreSQL Logging Handler will store logs in the database, by default
the current database, can be set using --log-db=DBNAME
"""
def emit(self, record):
@@ -58,7 +58,8 @@ class PostgreSQLHandler(logging.Handler):
if not dbname:
return
with tools.ignore(Exception), tools.mute_logger('odoo.sql_db'), sql_db.db_connect(dbname, allow_uri=True).cursor() as cr:
- cr.autocommit(True)
+ # preclude risks of deadlocks
+ cr.execute("SET LOCAL statement_timeout = 1000")
msg = tools.ustr(record.msg)
if record.args:
msg = msg % record.args