GithubHelp home page GithubHelp logo

Comments (4)

nfedyashev avatar nfedyashev commented on August 19, 2024

I'm not sure I fully understand your message.
Can you provide some code samples?

from retryable.

skrabadiloseidon avatar skrabadiloseidon commented on August 19, 2024

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.

nfedyashev avatar nfedyashev commented on August 19, 2024

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.

skrabadiloseidon avatar skrabadiloseidon commented on August 19, 2024

Thanks i will try it.

from retryable.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.