Comments (7)
Have you tried @Scheduled(cron = "0 0 */4 * * *")
as your expression for every 4 hours?
In the future, use markdown code fences to make things easier to read.
from gs-scheduling-tasks.
Hi,
I edited my post is fenced now , also edited the comment in java. It is supposed to be running every 4 hours.
What I meant is that , for instance:
Job1 is launched
Job1 is COMPLETED
Just after this Job1 is launched again , and again
the same goes for the other 2 jobs.
Sorry I didn't explain it like this before.
from gs-scheduling-tasks.
My suggestion is to alter your cron expression and use 0's in place of *'s as shown in the my comment.
from gs-scheduling-tasks.
oh! sorry
Let me try it this way then althought I thought * were used as a "any".
I will keep you posted about it.
thanks
from gs-scheduling-tasks.
Well, * (in any programming context) means any. You are saying "any second, any minute", which kind of undermines trying to ONLY hit every x hours. But "0 0 */4" is like "on the 0th second and the 0th minute, and any hour divisible by 4, then go". If you have a whole slew of cron jobs that happen every 4 hours, it gives you the power to stagger them to different
4:00:00, 4:00:01, 4:00:02, 4:00:03, ... 4:01:00, 4:01:01, etc. would qualify if you used *'s like that.
from gs-scheduling-tasks.
Hi!
it seems that I understood or misread some tutorial about this topic.
You were right, and now it works as I expected.
Thanks for your help
from gs-scheduling-tasks.
I have some issues with this Jobs triggering from multiple instances of the Pivotal Cloud. How to prevent this. Any suggestions??
from gs-scheduling-tasks.
Related Issues (11)
- Testing schedulers HOT 4
- Multiple Triggers from Cloud HOT 2
- Needs a rewrite HOT 1
- does not use awaitility HOT 3
- use variables from varenv for delay / rate HOT 5
- Inconsistent versions used for awaitility HOT 3
- Update minimum required version of Java to 17 HOT 1
- Fix wording that says this is a web application HOT 1
- Cannot autowire mongoRepositories inside the ScheduledTasks component HOT 4
- Missing testing example HOT 3
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 gs-scheduling-tasks.