changeset 2b38d6007a31 in trytond:5.0
details: https://hg.tryton.org/trytond?cmd=changeset;node=2b38d6007a31
description:
        Use autocommit connection to LISTEN

        This is needed to receive notification in a timely manner.

        issue9966
        review333541002
        (grafted from 579f51ed2a7801acc1cfe5eb676db5a0da461dbb)
diffstat:

 trytond/bus.py |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r bdfcb33dfe12 -r 2b38d6007a31 trytond/bus.py
--- a/trytond/bus.py    Fri Jan 01 16:10:47 2021 +0100
+++ b/trytond/bus.py    Sun Jan 03 13:00:26 2021 +0100
@@ -141,12 +141,11 @@
             raise NotImplemented
 
         logger.info("listening on channel '%s'", cls._channel)
-        conn = db.get_connection()
+        conn = db.get_connection(autocommit=True)
         pid = os.getpid()
         try:
             cursor = conn.cursor()
             cursor.execute('LISTEN "%s"' % cls._channel)
-            conn.commit()
 
             cls._messages[database] = messages = _MessageQueue(_cache_timeout)
 

Reply via email to