forked from brmlab/brmbar-github
Database: other exceptions
This commit is contained in:
parent
557d36cac3
commit
38838692c6
1 changed files with 4 additions and 0 deletions
|
@ -3,6 +3,8 @@
|
||||||
import psycopg2
|
import psycopg2
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
import time
|
import time
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class Database:
|
class Database:
|
||||||
"""self-reconnecting database object"""
|
"""self-reconnecting database object"""
|
||||||
|
@ -55,6 +57,8 @@ class Database:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
cur = self.db_conn.cursor() #how ugly is this?
|
cur = self.db_conn.cursor() #how ugly is this?
|
||||||
return self._execute(cur, query, attrs, level+1)
|
return self._execute(cur, query, attrs, level+1)
|
||||||
|
except Exception as ex:
|
||||||
|
logger.debug("_execute exception: %s", ex)
|
||||||
|
|
||||||
def commit(self):
|
def commit(self):
|
||||||
"""passes commit to db"""
|
"""passes commit to db"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue