Module.py: make get_db() threadsafe by having it create a new connection every time

This commit is contained in:
Brian S. Stephan 2011-06-20 22:08:49 -05:00
parent 152ef2a1ad
commit c08e7cabc0
1 changed files with 4 additions and 1 deletions

View File

@ -184,7 +184,10 @@ class Module(object):
See also db_module_registered, below.
"""
return self.conn
dbfile = self.config.get('dr.botzo', 'database')
conn = sqlite3.connect(dbfile)
conn.row_factory = sqlite3.Row
return conn
def db_module_registered(self, modulename):
"""