change the default sqlite timeout to 30 seconds
this should make the bot wait longer for table locks, assuming i read the docs right
This commit is contained in:
parent
a51f0cb54c
commit
4566d1734e
@ -174,7 +174,7 @@ class Module(object):
|
||||
"""
|
||||
|
||||
dbfile = self.config.get('dr.botzo', 'database')
|
||||
conn = sqlite3.connect(dbfile)
|
||||
conn = sqlite3.connect(dbfile, 30)
|
||||
conn.row_factory = sqlite3.Row
|
||||
|
||||
# setup regexp function in sqlite
|
||||
|
@ -475,9 +475,7 @@ class Markov(Module):
|
||||
values = []
|
||||
try:
|
||||
# need to create our own db object, since this is likely going to be in a new thread
|
||||
dbfile = self.config.get('dr.botzo', 'database')
|
||||
db = sqlite3.connect(dbfile)
|
||||
db.row_factory = sqlite3.Row
|
||||
db = self.get_db()
|
||||
query = 'SELECT target, chance FROM markov_chatter_target'
|
||||
cursor = db.execute(query)
|
||||
results = cursor.fetchall()
|
||||
|
Loading…
Reference in New Issue
Block a user