GithubHelp home page GithubHelp logo

Comments (2)

s-light avatar s-light commented on July 22, 2024

as i just found out
https://stackoverflow.com/a/43066502/574981

cron only has a resolution of 1 minute (there are other tools I think that may have finer resolutions but they are not standard on unix).

i just switched from supercronic to yacron as i like the yaml syntax very much..
and supercronic just supports it..

parse-crontab supports seconds.

as fare as i can tell it would be needed to be added to

maybe that is already all?!

if so i think i can write a pullrequest for this ;-)

from yacron.

gjcarneiro avatar gjcarneiro commented on July 22, 2024

May be a bit more tricky than that. The yacron main loop is a bit more lax:

  1. Test each job crontab, does it match the current minute? If so, start it
  2. Calculate how many seconds do we need to sleep until the start of the next minute
  3. Sleep those seconds
  4. Go back to step 1.

To support second precision, yacron would need to:

  1. wake up every second, instead of every minute
  2. the part "test each job crontab, does it match the current minute" would need to be tweaked:
    1. some cron jobs are specified with only minute precision, they should not "match" every second in one minute interval, otherwise they would be started 60 times per minute, we don't want that
    2. only the subset of the jobs that actually specify sub-minute precision should be allowed to test for a match multiple times per minute.

Personally I don't find it useful, but YMMV, and I wouldn't mind reviewing some code to do this.

from yacron.

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.