-
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
Add timeouts to sniper source config #5624
Conversation
@Gobberwart, thanks for your PR! By analyzing the annotation information on this pull request, we identified @YvesHenri, @solderzzc and @mhdasding to be potential reviewers |
Hi @Gobberwart. I've explained this LOTS of times. The only source that timeouts frequently is the pokewatchers. This is one source that I found, but it doesn't mean you NEED to use it. It is ALSO the only TROUBLESOME URL among the others. It doesnt only takes a few to load, but it also provides crap data. I almost removed it from the example file. I, actually, WILL remove it because people keep asking this over and over. Sniper was meant so that you could find and use your own source. |
Sorry, I completely disagree with you, and this is not "Invalid". I am also well aware of how timeouts work. Setting a short timeout on a source that should be quick allows a failure to be identified quickly. And for a source that is often slow, it allows users to provide time for it to respond rather than timing out 50-90% of the time. I cannot begin to tell you how many times I've had to modify the code of sniper.py to allow pokewatchers or pokesnipers time to respond. As for "crap data" - that's your opinion. I'm getting good responses from pokewatchers, it just takes a while to respond sometimes. Hence why I'd like to be able to allow a longer timeout for that source. We could increase the global timeout for all sources, but then... if localhost doesn't respond within a couple of seconds, something is seriously wrong with it, so why allow it more time? TL;DR - This is E-X-T-R-E-M-E-L-Y relevant :) |
Anyone else want to weigh in on this one? Seems @YvesHenri and I don't agree, so we need an independent evaluation. |
I also manually increase the global timeout in order for pokewatcher to respond in time, (and found a real Dragonite btw!). So finding a ways to adress this is a good idea. |
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 adding a user-configurable timeout is a good idea. Some people might want to overall increase the timeout values because they sit on slow networks, others in turn want to quickly skip unresponseive sources. The config value is not mandatory anyway and the default looks sane to me.
Short Description:
Sniper currently uses hard-coded values for timeout when trying to validate/retrieve data from sources. Some sources (eg. localhost:5000/raw_data) should have lower timeouts than others as they can be significantly slower.
This is now user-configurable per-source (default to 5 seconds) which allows users to configure higher timeouts for known slow sources, and lower timeouts for sources that should be fast.
Fixes/Resolves/Closes (please use correct syntax):