Skip to content

Commit 589ca50

Browse files
committed
Add retry to init
1 parent 556909a commit 589ca50

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

repo_helper/cli/commands/init.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,10 @@ def init_repo(repo_path: pathlib.Path, templates: jinja2.Environment) -> List[st
177177
license_url = base_license_url / "apache.txt"
178178

179179
if license_url is not None:
180-
response = license_url.get()
181-
if response.status_code == 200:
182-
license_text = response.text
180+
for attempt in [1, 2]:
181+
response = license_url.get()
182+
if response.status_code == 200:
183+
license_text = response.text
183184

184185
license_template = Environment( # nosec: B701
185186
loader=BaseLoader(),

0 commit comments

Comments
 (0)