0.0.1 • Published 7 years ago

@bongione/recurrent-task v0.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 years ago

recurrent-task

Start named task that repeat at the same interval, with some logging of how they're performing

Install

npm install @bongione/recurrent-task

Usage

To use the library

let {startRecurrentTask, stopRecurrentTask} = require('@bongione/recurrent-task')

function myRecurrentTask() {
    // Do something useful
}   

// Run the task every 10 minutes
startRecurrentTask('NAME_OF_TASK', myRecurrentTask, 10 * 60 * 1000)

process.on('SIGINT', () => {
    recurrent_tasks.stopRecurrentTask('NAME_OF_TASK')
})

License

Apache 2.0