Changeset - 8c781cb03412
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 5 years ago 2020-11-20 16:10:30
mads@kiilerich.com
Grafted from: 516bf0770096
repo-scan: log error and continue after failure creating a scanned repo

Continue after for example:
Exception: invalid repo name Foo
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/utils.py
Show inline comments
 
@@ -413,6 +413,7 @@ def repo2db_mapper(initial_repo_dict, re
 
                    if repo.description != 'unknown'
 
                    else '%s repository' % name)
 

	
 
            try:
 
            new_repo = repo_model._create_repo(
 
                repo_name=name,
 
                repo_type=repo.alias,
 
@@ -424,6 +425,10 @@ def repo2db_mapper(initial_repo_dict, re
 
                private=private,
 
                state=db.Repository.STATE_CREATED
 
            )
 
            except Exception as e:
 
                log.error('error creating %r: %s: %s', name, type(e).__name__, e)
 
                sa.rollback()
 
                continue
 
            sa.commit()
 
            # we added that repo just now, and make sure it has githook
 
            # installed, and updated server info
0 comments (0 inline, 0 general)