-
-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] - Support saving serialized scheduler and reinstating from serialized scheduler #140
Comments
I was working on this a couple of months back. Got really busy. completely lost context now. That's why I unassigned myself. Will try to take a fresh stab at it if I get time. But feel free to pick it up |
Trying to accomplish this in our project as well. Do you think the only fields that need to be serialized on the scheduler are jobs, location, and tagsUnique? |
I’d also include the tags map, and the time timewrapper. Are you looking at implementing here? Another option besides creating a struct with exported fields is to implement the serialize and deserialize methods on our structure, which I think is a more ideal route. I’d be happy to discuss / hack at this with you if you’re interested! |
Looks like you have to implement: |
For my current situation, being able to wait for running jobs to complete was enough to get me around this requirement. Our jobs are currently at specific times and are also non-critical in the way that if one run was skipped, no big deal. I do think this would be a good feature though. If I can find some time, maybe I'll take a run at it just for the experience and to lend a hand. I'm not 100% when I'll find the time though. I realized after I created this issue that do to everything being non-exported, it would be difficult to do something like this outside of the library itself. |
I don’t see this being implemented. |
Is your feature request related to a problem? Please describe
Source: #139
As a user of gocron, I would like to be able to save a scheduler when restarting my application.
Describe the solution you'd like
Expose methods to serialize and de-serialize the scheduler
Describe alternatives you've considered
Additional context
Example serialization: https://stackoverflow.com/questions/28020070/golang-serialize-and-deserialize-back
I am thinking we'll want to create another struct with export fields that is used for serializing and de-serializing the main scheduler struct which contains unexported fields (which cannot be serialized using gob).
The text was updated successfully, but these errors were encountered: