Added/corrected timeouts for sqlite3 database connections

Bumped mail plugin patch version for sqlite3 timeout change
Code formatting corrections
This commit is contained in:
Kevin Froman 2020-08-16 19:52:50 -05:00
parent 2a7c933321
commit 0b2658374b
13 changed files with 158 additions and 123 deletions

View file

@ -9,6 +9,7 @@ from onionrplugins.onionrevents import event
import onionrcrypto
from onionrutils import epoch, bytesconverter
from coredb import dbfiles
from etc.onionrvalues import DATABASE_LOCK_TIMEOUT
"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -48,8 +49,8 @@ class OnionrBlackList:
return retData
def _dbExecute(self, toExec, params = ()):
conn = sqlite3.connect(self.blacklistDB)
def _dbExecute(self, toExec, params=()):
conn = sqlite3.connect(self.blacklistDB, timeout=DATABASE_LOCK_TIMEOUT)
c = conn.cursor()
retData = c.execute(toExec, params)
conn.commit()