Skip to content

Commit 4f7e699

Browse files
author
sevastian.zhukov
committed
remove infinity loop, add max attempts, add exponential delay
1 parent 95c0e0b commit 4f7e699

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ jobs:
694694
- install-mbx-ci
695695
- run:
696696
name: Update version
697+
no_output_timeout: 20m
697698
command: python3 scripts/distribute-version.py
698699
- *save-cache-podmaster
699700
- *save-cache-gems

scripts/distribute-version.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
import time
33

44

5-
def push_pod(name):
6-
while True:
5+
def push_pod(name, max_attempts):
6+
for attempt in range(0, max_attempts):
77
status = subprocess.run('pod repo update && pod trunk push ' + name + '.podspec', shell=True)
88
if status.returncode == 0:
9-
break
10-
time.sleep(10)
9+
return
10+
time.sleep(60 * pow(2, attempt))
11+
raise Exception('Maximum number of attempts have been made for ' + name)
1112

1213

13-
push_pod('MapboxCoreNavigation')
14-
push_pod('MapboxNavigation')
14+
push_pod('MapboxCoreNavigation', 5)
15+
time.sleep(60)
16+
push_pod('MapboxNavigation', 5)

0 commit comments

Comments
 (0)