Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit fd86007

Browse files
Added ability to specify the number of upload attempts via command line. (#276)
* Added ability to specify the number of upload attempts via command line. * Update codecov/__init__.py * Update codecov/__init__.py * Update codecov/__init__.py * Update codecov/__init__.py Co-authored-by: Thomas Hu <[email protected]> Co-authored-by: Thomas Hu <[email protected]>
1 parent 812c700 commit fd86007

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

codecov/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ def main(*argv, **kwargs):
407407
help="Specify a custom pr number, provided automatically for supported CI companies",
408408
)
409409
advanced.add_argument("--tag", default=None, help="Git tag")
410+
advanced.add_argument(
411+
"--tries",
412+
default=3,
413+
type=int,
414+
help="Specify the total number of attempts to make when uploading coverage report",
415+
)
410416

411417
enterprise = parser.add_argument_group(
412418
"======================== Enterprise ========================"
@@ -1108,6 +1114,7 @@ def main(*argv, **kwargs):
11081114
res = retry_upload(
11091115
"%s/upload/v4?%s" % (codecov.url, urlargs),
11101116
requests.post,
1117+
retries=codecov.tries,
11111118
break_codes=(200, 400, 406),
11121119
verify=codecov.cacert,
11131120
headers={
@@ -1128,6 +1135,7 @@ def main(*argv, **kwargs):
11281135
s3 = retry_upload(
11291136
upload_url,
11301137
requests.put,
1138+
retries=codecov.tries,
11311139
verify=codecov.cacert,
11321140
data=reports_gzip,
11331141
headers={
@@ -1149,6 +1157,7 @@ def main(*argv, **kwargs):
11491157
res = retry_upload(
11501158
"%s/upload/v2?%s" % (codecov.url, urlargs),
11511159
requests.post,
1160+
retries=codecov.tries,
11521161
verify=codecov.cacert,
11531162
data=reports_gzip,
11541163
headers={

0 commit comments

Comments
 (0)