Giter Club home page Giter Club logo

Comments (4)

lucas34 avatar lucas34 commented on August 23, 2024

You have to specify in the builder the number of times you allow this jobs to retry.
.retry(max: Int)

If you want your job to run "forever" you can specify Int.max as retry count.
In the next version I'll probably update the retry function to allow a full unlimited retry.

from swiftqueue.

 avatar commented on August 23, 2024

It's not about the numbers of retries. I need to run a job every hour. When a job fails it could retry a couple of times.

The issue here is that the periodic job stops running after an error occurs + max retries. The max run isn't reached, it just stops running (never schedules another run).

JobBuilder(type: MyJob.type)
	.singleInstance(forId: "my_job")
	.periodic(count: Int.max, interval: 15) // 15 seconds is easier for testing
	.retry(max: 3)
	.schedule(manager: manager)

What I'm trying to achieve:

  1. A job is scheduled with a 1-hour interval
  2. When a job run fails it could retry (max: 3)
  3. After an hour the next job runs (even when the previous job has failed)

from swiftqueue.

lucas34 avatar lucas34 commented on August 23, 2024

In the current implementation, the retry count is not per attempt to run the job. It's global for the job.
We can implement a "retry per attempt" for periodic jobs. So the retry count will be reset to 0 each time the scheduled job runs.

from swiftqueue.

 avatar commented on August 23, 2024

Thanks for the quick response. If it works as intended you can close this issue.

from swiftqueue.

Related Issues (20)

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.