robfig / cron

a cron library for go
MIT License
13.15k stars 1.63k forks source link

Removing entry does not update the cron #515

Closed guhkun13 closed 9 months ago

guhkun13 commented 9 months ago

Hi again, I found an issue when I remove the entry from the cron, the next hit will still hit the same entry ID that should have been removed.

here is my code in golang

// get cron entry ID from my object save on database (synced between db and cron)
entryId := cron.EntryID(schedule.EntryId)

//Cronjob is wrapped object of *cron.Cron
CronJob.Remove(entryId)

Screenshot: image

Is there any step that I am missing ? Thank you

guhkun13 commented 9 months ago

[SOLVED] Turns out this is because the effect of wrong sync [issue closed on https://github.com/robfig/cron/issues/514] . It looks like the cron did not updated, but in actuality, it updated. So i will close this issue.