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.

Firing job one time

See original GitHub issue

Hi, what I want to achieve is delaying the task 30 min after it’s called. Is this code snippet a good way of doing it?

var schedule = require("node-schedule");

let startTime = new Date(Date.now + 1800000);

let j = schedule.scheduleJob({start: startTime, rule: '*/1 * * * * *'},function(){
    console.log("hello");
    j.cancel();
});

or there’s another way to do it better?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
santigimenocommented, Jun 22, 2017

Anyway, if you want to use node-schedule you can use a Date directly. See this test as an example.

0reactions
santigimenocommented, Nov 14, 2017

Closing it. Please reopen if there’s anything else that needs to be addressed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrongful Termination: Was Your Firing Illegal? - Nolo
Knowing if your firing was legal or illegal can be a complicated issue. Employers usually may fire you at any time but there...
Read more >
Reasons Employees Can Get Fired - The Balance
1 Employment at will means that an employee can be terminated at any time without any reason and without notice.
Read more >
Definition, Reasons for Getting Fired, Signs
Getting fired means that an employee's job is terminated for reasons such as poor work performance or unethical behavior such as stealing company...
Read more >
How to Fire an Employee: Tips for Letting Go
Knowing when to fire an employee can seem like an impossible task – and letting go of a problem employee is easier said...
Read more >
Let Go vs. Fired: Definitions and Tips To Move Forward - Indeed
Being let go or laid off from a job is different from getting fired both in how you receive benefits and how you...
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