Reviewers: ,


Please review this at http://codereview.tryton.org/153001/

Affected files:
  M tryton/rpc.py


Index: tryton/rpc.py
===================================================================
--- a/tryton/rpc.py
+++ b/tryton/rpc.py
@@ -73,16 +73,12 @@
     try:
         _SEMAPHORE.acquire()
         try:
-            connection = ServerProxy(host, port, database)
-            if str(connection) != str(CONNECTION):
-                if CONNECTION:
-                    CONNECTION.close()
-                CONNECTION = connection
-            else:
-                connection = CONNECTION
+            if CONNECTION:
+                CONNECTION.close()
+            CONNECTION = ServerProxy(host, port, database)
logging.getLogger('rpc.request').info('common.db.login(%s, %s)' %
                 (username, 'x' * 10))
-            result = connection.common.db.login(username, password)
+            result = CONNECTION.common.db.login(username, password)
             logging.getLogger('rpc.result').debug(repr(result))
         finally:
             _SEMAPHORE.release()


--
[email protected] mailing list

Reply via email to