...
|
...
|
@@ -10,7 +10,7 @@ function sleep(ms) { |
|
|
})
|
|
|
}
|
|
|
|
|
|
const TWENTY_MINUTES = 10 * 60 * 1000
|
|
|
const TEN_MINUTES = 10 * 60 * 1000
|
|
|
|
|
|
function getRandomInt(max) {
|
|
|
return Math.floor(Math.random() * Math.floor(max));
|
...
|
...
|
@@ -21,14 +21,14 @@ function main() { |
|
|
ruleIn.hour = 9
|
|
|
|
|
|
schedule.scheduleJob(ruleIn, function(){
|
|
|
sleep(getRandomInt(TWENTY_MINUTES)).then(checkin)
|
|
|
sleep(getRandomInt(TEN_MINUTES)).then(checkin)
|
|
|
});
|
|
|
|
|
|
const ruleOut = new schedule.RecurrenceRule()
|
|
|
ruleOut.hour = 18
|
|
|
|
|
|
schedule.scheduleJob(ruleOut, function(){
|
|
|
sleep(getRandomInt(TWENTY_MINUTES)).then(checkout)
|
|
|
sleep(getRandomInt(TEN_MINUTES)).then(checkout)
|
|
|
});
|
|
|
|
|
|
console.log('checkin start')
|
...
|
...
|
|