Changeset - 1b683a4eb9fc
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 5 years ago 2020-12-28 00:43:18
mads@kiilerich.com
Grafted from: b6354f238d1b
TurboGears: drop workaround for < 2.4

Backout a38e05a0c79e and tweak.
2 files changed with 2 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/celerylib/__init__.py
Show inline comments
 
@@ -101,11 +101,9 @@ def __get_lockkey(func, *fargs, **fkwarg
 
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
kallithea/model/async_tasks.py
Show inline comments
 
@@ -84,12 +84,9 @@ def get_commits_stats(repo_name, ts_min_
 
    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 = {}
0 comments (0 inline, 0 general)