db: logging option for cursor
In some cases we expect query to fail (LOCK NOWAIT) but it still clutters the logs. Option for not logging cursor-level errors. Fixes: https://pagure.io/koji/issue/2837
This commit is contained in:
parent
bc04708990
commit
e7db7d8b53
3 changed files with 10 additions and 6 deletions
|
|
@ -356,7 +356,7 @@ def handle_db_msgs(urls, CONFIG):
|
|||
# we're running in postCommit, so we need to handle new transaction
|
||||
c.execute('BEGIN')
|
||||
try:
|
||||
c.execute('LOCK TABLE proton_queue IN ACCESS EXCLUSIVE MODE NOWAIT')
|
||||
c.execute('LOCK TABLE proton_queue IN ACCESS EXCLUSIVE MODE NOWAIT', log=False)
|
||||
except psycopg2.OperationalError:
|
||||
LOG.debug('skipping db queue due to lock')
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue