add db timeout

This commit is contained in:
Damien Elmes 2011-09-29 15:57:29 +09:00
parent 40e9eea43f
commit 9b8e949a72

View file

@ -11,8 +11,8 @@ except ImportError:
from anki.hooks import runHook from anki.hooks import runHook
class DB(object): class DB(object):
def __init__(self, path, text=None): def __init__(self, path, text=None, timeout=0):
self._db = sqlite.connect(path, timeout=0) self._db = sqlite.connect(path, timeout=timeout)
if text: if text:
self._db.text_factory = text self._db.text_factory = text
self._path = path self._path = path