mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
add db timeout
This commit is contained in:
parent
40e9eea43f
commit
9b8e949a72
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue