Made long running tasks cancellable. Added cancel button to cancellable tasks in the task list. Added APP_MODE env variable for determining if the app is running in development, test, or production.

This commit is contained in:
mmonkey
2021-09-29 02:40:12 -05:00
parent 26071d4e7a
commit 46205a1f83
20 changed files with 346 additions and 153 deletions
+3 -3
View File
@@ -443,11 +443,11 @@ class CalibreDB():
"""
self.session = None
if self._init:
self.initSession(expire_on_commit)
self.init_session(expire_on_commit)
self.instances.add(self)
def initSession(self, expire_on_commit=True):
def init_session(self, expire_on_commit=True):
self.session = self.session_factory()
self.session.expire_on_commit = expire_on_commit
self.update_title_sort(self.config)
@@ -593,7 +593,7 @@ class CalibreDB():
autoflush=True,
bind=cls.engine))
for inst in cls.instances:
inst.initSession()
inst.init_session()
cls._init = True
return True