-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
pokecli.py: wait_time for every exception randomized #5704
Conversation
randint(min,max) config.reconnecting -> min config.reconnection * 60 -> max
@mudmud2k, thanks for your PR! By analyzing the annotation information on this pull request, we identified @TheSavior, @Gobberwart and @douglascamata to be potential reviewers |
Can't review now. Someone please do it and merge, if agreed. |
@@ -185,7 +186,7 @@ def get_commit_hash(): | |||
finished = False | |||
|
|||
while not finished: | |||
wait_time = config.reconnecting_timeout * 60 | |||
wait_time = randint(config.reconnecting_timeout, (config.reconnecting_timeout * 60)) |
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.
I think this needs adjustment and docs changes: previously, config.reconnecting_timeout was "time in minutes". Now the wait_time spans from this valud to the 60-times of it.
Maybe randint(config.reconnecting_timeout*60, (config.reconnecting_timeout + 1) * 60))
?
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.
an other possibility is to extend the config file with min and max entries, which I think is a overkill for that.
maybe only an random variation of the given time, something like 'randint((config.reconnecting_timeout * 0.8 * 60, config.reconnecting_timeout * 1.2 * 60))'
40% vast/span/range...
also, I don't find any documentation about it, but I thought that I saw an entry once.
) | ||
time.sleep(30) | ||
time.sleep(wait_time) | ||
# sys.exit() |
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.
should be removed
Any updates on this? |
still waiting for a review, or further discussion... but without a working api, there is no need for it.. |
This doesn't work as expected... wait_time = randint((config.reconnecting_timeout * 0.8 * 60), (config.reconnecting_timeout * 1.2 * 60)) randint requires two INTEGER values, whereas this line provides two FLOATS. Result:
|
Correction: works if reconnecting_timeout in config is set to default 15, or any multiple of 5, but fails if set to anything else. (5 x 0.8 = 12 (int), 5 x 1.2 = 18 (int). In my case, I have reconnecting_timeout set to 3, so 3 x 0.8 = 2.4 (float), 3 x 1.2 = 3.6 (float). |
* pokecli.py: wait_time for every exception randomized randint(min,max) config.reconnecting -> min config.reconnection * 60 -> max * randint(timeout * 0.8 * 60, timeout * 1.2 * 60; docs update
Feature Request (#5579)
Short Description:
it's create a random waiting time based on config for all exception (connection lost, throttling, and so on), so no static time span will be used anymore
randint(min,max)
config.reconnecting -> min
config.reconnection * 60 -> max