GithubHelp home page GithubHelp logo

Comments (7)

gregturn avatar gregturn commented on June 3, 2024

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.

rmordillo-witbooking avatar rmordillo-witbooking commented on June 3, 2024

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.

gregturn avatar gregturn commented on June 3, 2024

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.

rmordillo-witbooking avatar rmordillo-witbooking commented on June 3, 2024

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.

gregturn avatar gregturn commented on June 3, 2024

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.

rmordillo-witbooking avatar rmordillo-witbooking commented on June 3, 2024

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.

HemasekharT avatar HemasekharT commented on June 3, 2024

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)

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.