Twitter: Markov used our "need to create our own db object" logic and then improved it.

most importantly, don't clobber the first thread's db instances
This commit is contained in:
Brian S. Stephan 2011-05-01 10:42:24 -05:00
parent 5e8e93beba
commit c55852129a
1 changed files with 2 additions and 3 deletions

View File

@ -299,9 +299,8 @@ class Twitter(Module):
# need to create our own db object, since this is likely going
# to be called 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
db = sqlite3.connect(dbfile)
db.row_factory = sqlite3.Row
query = 'SELECT since_id FROM twitter_settings'
cursor = db.execute(query)
result = cursor.fetchone()