thp / urlwatch

Watch (parts of) webpages and get notified when something changes via e-mail, on your phone or via other means. Highly configurable.
https://thp.io/2008/urlwatch/
Other
2.81k stars 352 forks source link

Feature request: error threshold #735

Closed tyleroconnell closed 1 year ago

tyleroconnell commented 1 year ago

First off thank you @thp for all of your effort on urlwatch, I've been using it for the last two years and absolutely love it!

I recently re-enabled displaying errors in my configuration when I noticed some jobs had stopped working as expected (e.g., web page no longer existed). Since then I've seen some sites' reliability causes them to return errors sporadically, perhaps during site maintenance. Have you considered adding an error threshold setting, not dissimilar to compared_versions, that allows the user to configure the number of errors that then pass the threshold to trigger?

If you're open to the idea and could point me in the right direction, I'd be happy to take a stab at its implementation. I could see it going in either configuration for a global value to use for all jobs or as an optional key for all job types to allow for more granular configuration. I see greater benefit in the latter myself but also bring up the former in the case you think that would reduce the complexity adding this feature might bring.

Apologies if this has been asked in its own issue before, all I was able to find was this comment in reference to #143 and the implementation of max_tries.

thp commented 1 year ago

There's a way to ignore certain HTTP error codes:

https://urlwatch.readthedocs.io/en/latest/advanced.html#ignoring-connection-errors

What's different between this proposed feature and the max_tries feature?

tyleroconnell commented 1 year ago

Ah that's my mistake, I thought max_tries was for immediate retries.