-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Import tenacity
library and use it in cluster_read.py
#109
Conversation
70d7f91
to
cbfcfef
Compare
core/opl/cluster_read.py
Outdated
@@ -178,6 +179,7 @@ def _sanitize_target(self, target): | |||
target = target.replace("$Cloud", self.args.grafana_prefix) | |||
return target | |||
|
|||
@retry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many times it will retry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better now?
cbfcfef
to
94cf728
Compare
Use it to retry POST requests to Grafana which seems to close/reset connections under load. [Tenacity](https://tenacity.readthedocs.io/en/latest/)
40f5c30
to
6b91480
Compare
6b91480
to
ba78d27
Compare
@@ -178,6 +179,8 @@ def _sanitize_target(self, target): | |||
target = target.replace("$Cloud", self.args.grafana_prefix) | |||
return target | |||
|
|||
# pylint: disable-next=undefined-variable | |||
@retry(stop=(stop_after_delay(10) | stop_after_attempt(10))) # noqa: F405 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW never used |
in python, thanks! https://stackoverflow.com/questions/5988665/pipe-character-in-python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
Use it to retry POST requests to Grafana which seems to close/reset connections under load.
Tenacity