changeset 8815:1b683a4eb9fc

TurboGears: drop workaround for < 2.4 Backout a38e05a0c79e and tweak.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 28 Dec 2020 00:43:18 +0100
parents 4a18e6bf6b87
children c76638100ca0
files kallithea/lib/celerylib/__init__.py kallithea/model/async_tasks.py
diffstat 2 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/celerylib/__init__.py	Fri Dec 18 22:03:10 2020 +0100
+++ b/kallithea/lib/celerylib/__init__.py	Mon Dec 28 00:43:18 2020 +0100
@@ -101,11 +101,9 @@
 def locked_task(func):
     def __wrapper(func, *fargs, **fkwargs):
         lockkey = __get_lockkey(func, *fargs, **fkwargs)
-        lockkey_path = config.get('cache_dir') or config['app_conf']['cache_dir']  # Backward compatibility for TurboGears < 2.4
-
         log.info('running task with lockkey %s', lockkey)
         try:
-            l = DaemonLock(os.path.join(lockkey_path, lockkey))
+            l = DaemonLock(os.path.join(config['cache_dir'], lockkey))
             ret = func(*fargs, **fkwargs)
             l.release()
             return ret
--- a/kallithea/model/async_tasks.py	Fri Dec 18 22:03:10 2020 +0100
+++ b/kallithea/model/async_tasks.py	Mon Dec 28 00:43:18 2020 +0100
@@ -84,12 +84,9 @@
     DBS = celerylib.get_session()
     lockkey = celerylib.__get_lockkey('get_commits_stats', repo_name, ts_min_y,
                             ts_max_y)
-    lockkey_path = config.get('cache_dir') or config['app_conf']['cache_dir']  # Backward compatibility for TurboGears < 2.4
-
     log.info('running task with lockkey %s', lockkey)
-
     try:
-        lock = celerylib.DaemonLock(os.path.join(lockkey_path, lockkey))
+        lock = celerylib.DaemonLock(os.path.join(config['cache_dir'], lockkey))
 
         co_day_auth_aggr = {}
         commits_by_day_aggregate = {}