Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Added ability to specify the number of upload attempts via command li…
Browse files Browse the repository at this point in the history
…ne. (#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 <thomasrockhu@users.noreply.github.com>
Co-authored-by: Thomas Hu <tomhu1096@gmail.com>
  • Loading branch information
3 people committed Jun 22, 2020
1 parent 812c700 commit fd86007
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions codecov/__init__.py
Expand Up @@ -407,6 +407,12 @@ def main(*argv, **kwargs):
help="Specify a custom pr number, provided automatically for supported CI companies",
)
advanced.add_argument("--tag", default=None, help="Git tag")
advanced.add_argument(
"--tries",
default=3,
type=int,
help="Specify the total number of attempts to make when uploading coverage report",
)

enterprise = parser.add_argument_group(
"======================== Enterprise ========================"
Expand Down Expand Up @@ -1108,6 +1114,7 @@ def main(*argv, **kwargs):
res = retry_upload(
"%s/upload/v4?%s" % (codecov.url, urlargs),
requests.post,
retries=codecov.tries,
break_codes=(200, 400, 406),
verify=codecov.cacert,
headers={
Expand All @@ -1128,6 +1135,7 @@ def main(*argv, **kwargs):
s3 = retry_upload(
upload_url,
requests.put,
retries=codecov.tries,
verify=codecov.cacert,
data=reports_gzip,
headers={
Expand All @@ -1149,6 +1157,7 @@ def main(*argv, **kwargs):
res = retry_upload(
"%s/upload/v2?%s" % (codecov.url, urlargs),
requests.post,
retries=codecov.tries,
verify=codecov.cacert,
data=reports_gzip,
headers={
Expand Down

0 comments on commit fd86007

Please sign in to comment.