Changeset - 6ca4f9f68eb5
[Not reviewed]
default
0 2 0
Mads Kiilerich - 8 years ago 2017-08-12 17:40:01
mads@kiilerich.com
make-index: move make_index.lock to the index location - don't assume that the .ini directory is writable
2 files changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/paster_commands/make_index.py
Show inline comments
 
@@ -48,26 +48,25 @@ class Command(BasePasterCommand):
 
        repo_list = map(strip, args.repo_list.split(',')) \
 
            if args.repo_list else None
 

	
 
        repo_update_list = map(strip, args.repo_update_list.split(',')) \
 
            if args.repo_update_list else None
 

	
 
        #======================================================================
 
        # WHOOSH DAEMON
 
        #======================================================================
 
        from kallithea.lib.pidlock import LockHeld, DaemonLock
 
        from kallithea.lib.indexers.daemon import WhooshIndexingDaemon
 
        try:
 
            l = DaemonLock(file_=os.path.join(dirname(dirname(index_location)),
 
                                              'make_index.lock'))
 
            l = DaemonLock(file_=os.path.join(index_location, 'make_index.lock'))
 
            WhooshIndexingDaemon(index_location=index_location,
 
                                 repo_location=repo_location,
 
                                 repo_list=repo_list,
 
                                 repo_update_list=repo_update_list) \
 
                .run(full_index=args.full_index)
 
            l.release()
 
        except LockHeld:
 
            sys.exit(1)
 

	
 
    def get_parser(self, prog_name):
 
        parser = super(Command, self).get_parser(prog_name)
 

	
kallithea/tests/fixture.py
Show inline comments
 
@@ -402,17 +402,17 @@ def create_test_env(repos_test_path, con
 
def create_test_index(repo_location, config, full_index):
 
    """
 
    Makes default test index
 
    """
 

	
 
    from kallithea.lib.indexers.daemon import WhooshIndexingDaemon
 
    from kallithea.lib.pidlock import DaemonLock, LockHeld
 

	
 
    index_location = os.path.join(config['index_dir'])
 
    if not os.path.exists(index_location):
 
        os.makedirs(index_location)
 

	
 
    l = DaemonLock(file_=os.path.join(dirname(index_location), 'make_index.lock'))
 
    l = DaemonLock(file_=os.path.join(index_location, 'make_index.lock'))
 
    WhooshIndexingDaemon(index_location=index_location,
 
                         repo_location=repo_location) \
 
        .run(full_index=full_index)
 
    l.release()
0 comments (0 inline, 0 general)