I am sorry to be asking a rather simple question here, I tried and went through the codebase but I figured I still need some input from your side.
I have a simple use case. I have a node.js CLI app. When I run a certain command, I schedule a few jobs and the node execution that queues and starts the jobs exits of course. Now, I would like to have another CLI command let's say myapp stop that should be able to stop all previously enqueued jobs. As per my understanding, the new node process executing the myapp stop command would have no link whatsoever to anything the toad schedular is doing in memory. Take a look at this snippent.
export const beginScheduledJobs = (): void => {
// App must be configured.
if (getConfig('state') !== 'ready') {
return;
}
// Instantiate new schedular.
const scheduler = new ToadScheduler();
// Queue some jobs
scheduler.addSimpleIntervalJob(idleCheckJob);
};
/**
* Stops all scheduled jobs.
*/
export const stopScheduledJobs = (): void => {
// What should I do here ?
};
As you can see, the beginScheduledJobs() method would be called by my apps start command, and the stopScheduledJobs is to be called on-demand by the user later by my app's stop command. Any help would be greatly appreciated.
I am sorry to be asking a rather simple question here, I tried and went through the codebase but I figured I still need some input from your side.
I have a simple use case. I have a node.js CLI app. When I run a certain command, I schedule a few jobs and the node execution that queues and starts the jobs exits of course. Now, I would like to have another CLI command let's say
myapp stopthat should be able to stop all previously enqueued jobs. As per my understanding, the new node process executing themyapp stopcommand would have no link whatsoever to anything the toad schedular is doing in memory. Take a look at this snippent.As you can see, the
beginScheduledJobs()method would be called by my appsstartcommand, and thestopScheduledJobsis to be called on-demand by the user later by my app'sstopcommand. Any help would be greatly appreciated.