Commit 3c6bf59e authored by Hamza Dely's avatar Hamza Dely

[annuaire_pg] N'appele pas .set_session() si transaction en cours

parent 3a948b3e
......@@ -36,7 +36,8 @@ def _need_conn(f):
time.sleep(delay)
conn = psycopg2.connect(user='crans_ro', database='django',
host=host)
conn.set_session(autocommit=True)
if conn.status != psycopg2.extensions.STATUS_IN_TRANSACTION:
conn.set_session(autocommit=True)
return f(*args, **kwargs)
except psycopg2.OperationalError:
attempts += 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment