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:
Brian S. Stephan 2011-07-01 18:42:49 -05:00
parent a51f0cb54c
commit 4566d1734e
2 changed files with 2 additions and 4 deletions

View File

@ -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

View File

@ -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()