Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

64
Views
Problem with the function update of cron-job-manager

I'm using the lib cron-job-manager to manage my cron because i'm running multiple crons in my app but i have an issue when i want to update the specific cron i do it like this:

manager.update(alertData.id.toString(), cronFinal)

But it's not working when i see the function it take this as arguments:

update(...args: any): void

The documentation says

You may want to change the task, time or both of any job during execution. You can do so using the update function

manager.update('key', '0 15 3,5,9,14,18,20 * * *', () => {// do this instead on this new schedule
});
manager.update('key', () => { // do this instead 
});
manager.update('key', '0 15 3,5,9,14,18,20 * * *') // do it on this schedule instead.

The error i have is this one;

error updating tab: 33 - Cannot read property 'running' of undefined

33 corresponding to the id.toString() i'm using

Can someone tell me what i am doing wrong pls ?

Thanks by advance :D

7 months ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.