Changeset - 5aa9fa97306f
[Not reviewed]
default
0 5 0
Mads Kiilerich - 8 years ago 2017-08-12 17:40:01
mads@kiilerich.com
lib: make the DaemonLock lock location parameter mandatory - the default was never used
5 files changed with 7 insertions and 9 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/celerylib/__init__.py
Show inline comments
 
@@ -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
kallithea/lib/celerylib/tasks.py
Show inline comments
 
@@ -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('"', "")
kallithea/lib/paster_commands/make_index.py
Show inline comments
 
@@ -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,
kallithea/lib/pidlock.py
Show inline comments
 
@@ -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
kallithea/tests/fixture.py
Show inline comments
 
@@ -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)
0 comments (0 inline, 0 general)