Comments (4)
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.
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:
- A job is scheduled with a 1-hour interval
- When a job run fails it could retry (max: 3)
- After an hour the next job runs (even when the previous job has failed)
from swiftqueue.
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.
Thanks for the quick response. If it works as intended you can close this issue.
from swiftqueue.
Related Issues (20)
- Last persisted job appears to run twice (before and after app restart) HOT 5
- How to cancel a particular job in version 5 now that UUID has been removed HOT 3
- Possibility of running N concurrent jobs inside a queue HOT 2
- WatchOS support HOT 2
- Periodic run just once HOT 2
- EXC_BAD_ACCESS in the method createQueue HOT 4
- The waitUntilAllOperationsAreFinished method is called before completion HOT 2
- Not able to access registerForBackgroundTask method in SwiftQueueManager+BackgroundTask HOT 2
- <compiler-generated> SwiftQueueManager.enqueue(info:) HOT 3
- Support NSOperation Dependency HOT 2
- Crash when enqueue from multiples thread HOT 5
- <compiler-generated> SwiftQueueManager.enqueue(info:) #408 HOT 1
- Is it possible to start Foreground initiated jobs that continue background execution? HOT 2
- Replace Reachability dependency with NWPathMonitor usage HOT 4
- Get additional info for a job HOT 10
- extensible DefaultConstraintMaker for persist-able queue manager HOT 1
- Flaky test HOT 1
- Multiple Parallel Periodic jobs do not run in parallel HOT 2
- Can't persist jobs, Thread 1: "Invalid type in JSON write (__SwiftValue)" HOT 3
- A random crash 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 swiftqueue.