1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-30 23:03:02 +00:00

Session no longer expires on commit

This commit is contained in:
Ozzieisaacs
2020-12-08 08:01:42 +01:00
parent 5e3618716d
commit d15d252af7
2 changed files with 18 additions and 12 deletions

View File

@@ -426,18 +426,19 @@ class CalibreDB():
# instances alive once they reach the end of their respective scopes
instances = WeakSet()
def __init__(self):
def __init__(self, expire_on_commit=False):
""" Initialize a new CalibreDB session
"""
self.session = None
if self._init:
self.initSession()
self.initSession(expire_on_commit)
self.instances.add(self)
def initSession(self):
def initSession(self, expire_on_commit):
self.session = self.session_factory()
self.session.expire_on_commit = expire_on_commit
self.update_title_sort(self.config)
@classmethod