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')
|
dbfile = self.config.get('dr.botzo', 'database')
|
||||||
conn = sqlite3.connect(dbfile)
|
conn = sqlite3.connect(dbfile, 30)
|
||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
|
|
||||||
# setup regexp function in sqlite
|
# setup regexp function in sqlite
|
||||||
|
@ -475,9 +475,7 @@ class Markov(Module):
|
|||||||
values = []
|
values = []
|
||||||
try:
|
try:
|
||||||
# need to create our own db object, since this is likely going to be in a new thread
|
# 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 = self.get_db()
|
||||||
db = sqlite3.connect(dbfile)
|
|
||||||
db.row_factory = sqlite3.Row
|
|
||||||
query = 'SELECT target, chance FROM markov_chatter_target'
|
query = 'SELECT target, chance FROM markov_chatter_target'
|
||||||
cursor = db.execute(query)
|
cursor = db.execute(query)
|
||||||
results = cursor.fetchall()
|
results = cursor.fetchall()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user