Markov: don't clobber existing database objects in the forked thread

This commit is contained in:
Brian S. Stephan 2011-05-01 10:20:08 -05:00
parent a73aec8ff0
commit 7692d295f6
1 changed files with 3 additions and 3 deletions

View File

@ -382,9 +382,9 @@ class Markov(Module):
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')
self.conn = sqlite3.connect(dbfile)
self.conn.row_factory = sqlite3.Row
db = self.conn
conn = sqlite3.connect(dbfile)
conn.row_factory = sqlite3.Row
db = conn
query = 'SELECT target FROM markov_chatter_target'
cursor = db.execute(query)
results = cursor.fetchall()