mycoboco / ontime Goto Github PK
View Code? Open in Web Editor NEWa human-readable cron
Home Page: http://code.woong.org/ontime
License: Other
a human-readable cron
Home Page: http://code.woong.org/ontime
License: Other
hi @mycoboco,
I have an issue while using cycle at specific time.
It is working at "10:18:20" but its not working at "2018-01-05T10:18:20" and "2018-01-05 10:18:20" .
Do you have any idea about it?
I didn't see a way of doing this but having jobs start between certain times would be nice. For example, I have sensors where I collect data every minute or so during the day time and every 5 minutes or more during the night. Therefore if a time is greater than 07:30 then very 1 minute, if time is greater than 20:00 then every 5 minutes. Thanks, like your OT.
Allow these actions within task functions:
Given this code
ontime({
cycle: [ '0', '5', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55' ],
single: true,
log: true
}, function (ot) {
// ...
ot.done()
})
ontime
failed to correctly run the job for 30
and, sometimes, 0
.
No problem with single
set to false
.
ontime({
cycle: ['10'],
step: 2,
log: true,
single: true
}, (ot) => {
console.log('run');
ot.done();
});
gives
[ontime] 0: will wait for NaN step(s) to run
Hi,
Thanks for this, it works great and saves a lot of time.
Is there a way to specify weekdays only and omit weekends?
Or should I just add every day of the week to the array?
I'd like a job that runs every 5 minutes from 7am-9am Mon-Fri.
I would like to terminate or cancel an instant of an onTime so that I could programmically restart it using a different setting. Therefore, I tried using ot.cancel(); I assumed that is what this is for but was unsure.
As a test, I was using the ontime module to trigger every minute and when the minute >= ## then I called ot.cancel().
if(myMin >= 50) ot.cancel();
When I tried using this, I get the following error
/home/web/node_modules/ontime/index.js:209
cancelTimeout(then.timer)
ReferenceError: cancelTimeout is not defined
Ideally, I would like to kill an instance of onTime using the id and use it anywhere in the code with just ot.cancel(id);
Thanks for your help.
Allowing different types of schedules in a single specification is useful, for example, when single: true
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.