bamzi / jobrunner

Framework for performing work asynchronously, outside of the request flow
MIT License
1.04k stars 99 forks source link

change job execution state #11

Closed tetsuyanh closed 5 years ago

tetsuyanh commented 5 years ago

We have a case want to stop scheduled jobs temporarily.

It's ok to kepp state on memory. We setup schedule with execution state, and change enable/disable on statusPage.

tetsuyanh commented 5 years ago

How about this enhancement? I would like to try PR if it is attractive.

bamzi commented 5 years ago

@tetsuyanh I'll review the pull request. Pause function for 1 or group of jobs mid-cycle may cause some unforeseen problems with the entire lib. I don't want to break backward compatibility.

tetsuyanh commented 5 years ago

@bamzi I understood your policy and concern. I will try this as possible as I can.

tetsuyanh commented 5 years ago

@bamzi It is enough to pause by using jobrunner.Remove() and jobrunner.Schedule(). I provide web endpoint to wrap these functions.

Thanks.