##// END OF EJS Templates
TurboGears: drop workaround for < 2.4...
Mads Kiilerich -
r8599:1b683a4e default
parent child Browse files
Show More
@@ -101,11 +101,9 b' def __get_lockkey(func, *fargs, **fkwarg'
101 def locked_task(func):
101 def locked_task(func):
102 def __wrapper(func, *fargs, **fkwargs):
102 def __wrapper(func, *fargs, **fkwargs):
103 lockkey = __get_lockkey(func, *fargs, **fkwargs)
103 lockkey = __get_lockkey(func, *fargs, **fkwargs)
104 lockkey_path = config.get('cache_dir') or config['app_conf']['cache_dir'] # Backward compatibility for TurboGears < 2.4
105
106 log.info('running task with lockkey %s', lockkey)
104 log.info('running task with lockkey %s', lockkey)
107 try:
105 try:
108 l = DaemonLock(os.path.join(lockkey_path, lockkey))
106 l = DaemonLock(os.path.join(config['cache_dir'], lockkey))
109 ret = func(*fargs, **fkwargs)
107 ret = func(*fargs, **fkwargs)
110 l.release()
108 l.release()
111 return ret
109 return ret
@@ -84,12 +84,9 b' def get_commits_stats(repo_name, ts_min_'
84 DBS = celerylib.get_session()
84 DBS = celerylib.get_session()
85 lockkey = celerylib.__get_lockkey('get_commits_stats', repo_name, ts_min_y,
85 lockkey = celerylib.__get_lockkey('get_commits_stats', repo_name, ts_min_y,
86 ts_max_y)
86 ts_max_y)
87 lockkey_path = config.get('cache_dir') or config['app_conf']['cache_dir'] # Backward compatibility for TurboGears < 2.4
88
89 log.info('running task with lockkey %s', lockkey)
87 log.info('running task with lockkey %s', lockkey)
90
91 try:
88 try:
92 lock = celerylib.DaemonLock(os.path.join(lockkey_path, lockkey))
89 lock = celerylib.DaemonLock(os.path.join(config['cache_dir'], lockkey))
93
90
94 co_day_auth_aggr = {}
91 co_day_auth_aggr = {}
95 commits_by_day_aggregate = {}
92 commits_by_day_aggregate = {}
General Comments 0
You need to be logged in to leave comments. Login now