Golang cron package remove all jobs

I am using /robofig/cron package and added a cron job that runs every 15 minutes and fetches rows from a db table. Each row contains a task and a schedule when to run that task. I am looping over these rows and adding into cron jobs as per schedule of each row.

Now after 15 minutes the main cron updates the array of all rows fetched from db table and the above procedure repeats over and over again.

The problem is every 15 mins the rows just keeps on adding to the cron jobs making everything duplicate. How can I flush all previously added jobs before adding those again after every 15 mins keeping the main cron running ?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.