question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Is it possible to target a specific job to stop rather than to stop the whole scheduler?

See original GitHub issue
const { ToadScheduler, SimpleIntervalJob, AsyncTask } = require('toad-scheduler')

const scheduler = new ToadScheduler()

const task = new AsyncTask(
    'simple task', 
    () => { return db.pollForSomeData().then((result) => { /* continue the promise chain */ }) },
    (err: Error) => { /* handle error here */ }
)
const job = new SimpleIntervalJob({ seconds: 20, }, task)

scheduler.addSimpleIntervalJob(job)

// when stopping your app
scheduler.stop()

New to toad-scheduler. Is there a way to target a specific job, for termination? scheduler.stop() seems to end all running jobs.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kibertoadcommented, May 16, 2021

@jenseneducation-mattias-von-vogelsang Just published 1.2.0 with the stopping/starting functionality.

1reaction
mattiaslvvcommented, May 16, 2021

Thank you kindly for your implementation. I’ll try it out tomorrow. Closing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to stop a scheduled task that was started using ...
When the scheduling for a bean has to be stopped, you can lookup the map to get the corresponding Future to it and...
Read more >
Set a task start or finish date (constraint) for a task
You can't technically remove a constraint, but you can reset it to the default value, tying it to other tasks rather than to...
Read more >
FAQs - Jobs at Target
Yes, you can apply for more than one role at a time and use the same candidate profile. However, we do recommend that...
Read more >
10 Strategies for Better Time Management - UGA Extension
Learn 10 strategies for better time management, including knowing how to spend your time, setting priorities, using planning tools, getting organized, ...
Read more >
Managing Flexible Work Arrangements - SHRM
A telemarketing operation or help-desk call center can be physically located anywhere. An organization might be able to attract a better and larger...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found