jaumard / sails-hook-schedule

Hook to manage basic cron job for sails application
21 stars 6 forks source link

How does works startTask / stopTask #3

Closed Jean-PhilippeD closed 8 years ago

Jean-PhilippeD commented 8 years ago

Hi, I've a few questions about usage of the hook. First, how do I enabled / disable a task ? by changing the value of "enabled" ? Then, what is the purpose of startTask ? Run a task now or just enable it ? (same question for stopTask)

And last question, If I add a task through database (model) while sails is running, do I have to restart sails ? I've seen the a reloadTask once tasks is created but I'm not sure of what it does..

Thanks ! :)

jaumard commented 8 years ago

Hi,

First, how do I enabled / disable a task ? by changing the value of "enabled" ? Tasks under config file can't be enabled/disabled, database tasks can by settings the value of enabled and when a tasks is created/updated it will be start automatically by the reloadTask (if it's enabled).

startTask and stopTask are here if you don't use database and want to start/stop tasks under config file.