Skip to content

Commit ffd1404

Browse files
committed
Increase resiliency when there are repo or install specific errors
1 parent aea95ad commit ffd1404

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

gitconsensusservice/jobs/consensus.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ def process_installs(synchronous=False):
88
installs = gh.get_installations()
99
for install in installs:
1010
if synchronous:
11-
process_installation(install, True)
11+
try:
12+
process_installation(install, True)
13+
except Exception as error:
14+
print('Failed to process install %s due to error:' % install)
15+
print(error)
1216
else:
1317
process_installation.delay(install)
1418

@@ -20,7 +24,12 @@ def process_installation(installation_id, synchronous=False):
2024
repositories = installation.get_repositories()
2125
for repository in repositories:
2226
user, repo = repository.split('/')
23-
process_repository(installation_id, user, repo, True)
27+
try:
28+
process_repository(installation_id, user, repo, True)
29+
except Exception as error:
30+
print('Failed to process %s/%s due to error:' % (user, repo))
31+
print(error)
32+
2433

2534

2635
@celery.task

0 commit comments

Comments
 (0)