Comments (4)
I'm not sure I fully understand your message.
Can you provide some code samples?
from retryable.
I try to explain it with art of pseudo code:
loop do
Retryable.retryable(tries: 3, sleep: 10) times do
mysql.insert("data")
end
end
- I run the code, now i restart the mysql server, the mysql.insert code raises an exception => tries +1
- The server ist back online, mysql.insert ist working again
- Next day in need to restart the mysql server again => mysql.insert exception => tries +1
- Next day the same=> tries +1 => tries is now 3 => script ends
Now my idea: An option to tell retryable: retry this 3 times. after x seconds reset tries back to 0, so i have 3 tries again.
Failure example: Mysql server is restarted in 10 seconds => short problem, tries resetted, script working again
Failure example: Mysql server crashed because hdd full => long problem, more then x tries in x seconds => no reset, script ends and raises final exception
from retryable.
Wouldn't a combination of :not
option + retries count comparison solve this use case?
https://github.com/nfedyashev/retryable#matching-error-messages - that's how you can check how many tries did it make.
If it is above a certain threshold raise a custom exception that's listed in :not
array - https://github.com/nfedyashev/retryable#specify-exceptions-where-a-retry-should-not-be-performed
from retryable.
Thanks i will try it.
from retryable.
Related Issues (8)
- Force-trigger exception/retry HOT 2
- Rubygems contains version not available in repo HOT 1
- constant ::TimeoutError is deprecated HOT 2
- Reminder for future self - restore simplecov
- Readme is confusing regarding sleep vs sleep_method HOT 1
- Publish a version of this gem? HOT 1
- Update image version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retryable.