Closed cgyy closed 9 years ago
Hm, what would the identifier be?
just like this, when a entry adde to cron, then generate a UUID or some randome string in the entry
That's a good idea. It could even just be an incrementing integer
Any update for the RemoveJob? I think the RemoveJob function will help cron to be really useful library for Golang.
+1
I have implemented RemoveFunc, PauseFunc and ResumeFunc and created pull request, waiting for @robfig to merge. But it's less likely to happen as this project seems to be less active in development now, though the code is very useful. Here are the links: https://github.com/elgs/cron https://github.com/robfig/cron/pull/15/files
Brilliang @eigs. I use this library in many projects to do all the scheduling of background tasks.
Thanks @ahall. This is totally awesome library. I hope robfig will consider to merge the RemoveFunc, PauseFunc and ResumeFunc to the code.
@ahall but be careful, if you use my code, the AddFunc returns a jobId int, and the error, as opposed to the original error, the jobId is the handler for you to reference the job instance when you want to Remove, Pause or Resume the job in the future. This actually has changed the AddFunc return values.
Thanks @elgs. Yes, what you're doing makes sense!
Any update on this? I need that too :(
This feature was added in https://github.com/robfig/cron/commit/2b666ea6e8456493a58c35ee494f95ebe1207f38
Please let me know if it does not meet your needs.
Yes, thanks, It's a great job!
Is this feature just available in the v2 branch and no tagged versions?
func (c *Cron) RemoveJob(identifier string) { //remove job by identifier }
i think add a method like this is useful