diff --git a/kallithea/lib/celerylib/__init__.py b/kallithea/lib/celerylib/__init__.py --- a/kallithea/lib/celerylib/__init__.py +++ b/kallithea/lib/celerylib/__init__.py @@ -109,7 +109,7 @@ def locked_task(func): log.info('running task with lockkey %s', lockkey) try: - l = DaemonLock(file_=os.path.join(lockkey_path, lockkey)) + l = DaemonLock(os.path.join(lockkey_path, lockkey)) ret = func(*fargs, **fkwargs) l.release() return ret diff --git a/kallithea/lib/celerylib/tasks.py b/kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py +++ b/kallithea/lib/celerylib/tasks.py @@ -82,7 +82,7 @@ def get_commits_stats(repo_name, ts_min_ log.info('running task with lockkey %s', lockkey) try: - lock = l = celerylib.DaemonLock(file_=os.path.join(lockkey_path, lockkey)) + lock = celerylib.DaemonLock(os.path.join(lockkey_path, lockkey)) # for js data compatibility cleans the key for person from ' akc = lambda k: person(k).replace('"', "") diff --git a/kallithea/lib/paster_commands/make_index.py b/kallithea/lib/paster_commands/make_index.py --- a/kallithea/lib/paster_commands/make_index.py +++ b/kallithea/lib/paster_commands/make_index.py @@ -57,7 +57,7 @@ class Command(BasePasterCommand): from kallithea.lib.pidlock import LockHeld, DaemonLock from kallithea.lib.indexers.daemon import WhooshIndexingDaemon try: - l = DaemonLock(file_=os.path.join(index_location, 'make_index.lock')) + l = DaemonLock(os.path.join(index_location, 'make_index.lock')) WhooshIndexingDaemon(index_location=index_location, repo_location=repo_location, repo_list=repo_list, diff --git a/kallithea/lib/pidlock.py b/kallithea/lib/pidlock.py --- a/kallithea/lib/pidlock.py +++ b/kallithea/lib/pidlock.py @@ -28,18 +28,16 @@ class DaemonLock(object): """daemon locking USAGE: try: - l = DaemonLock(file_='/path/tolockfile',desc='test lock') + l = DaemonLock('/path/tolockfile',desc='test lock') main() l.release() except LockHeld: sys.exit(1) """ - def __init__(self, file_=None, callbackfn=None, + def __init__(self, file_, callbackfn=None, desc='daemon lock', debug=False): - - lock_name = os.path.join(os.path.dirname(__file__), 'running.lock') - self.pidfile = file_ if file_ else lock_name + self.pidfile = file_ self.callbackfn = callbackfn self.desc = desc self.debug = debug diff --git a/kallithea/tests/fixture.py b/kallithea/tests/fixture.py --- a/kallithea/tests/fixture.py +++ b/kallithea/tests/fixture.py @@ -411,7 +411,7 @@ def create_test_index(repo_location, con if not os.path.exists(index_location): os.makedirs(index_location) - l = DaemonLock(file_=os.path.join(index_location, 'make_index.lock')) + l = DaemonLock(os.path.join(index_location, 'make_index.lock')) WhooshIndexingDaemon(index_location=index_location, repo_location=repo_location) \ .run(full_index=full_index)