mvniekerk / tokio-cron-scheduler

Schedule tasks on Tokio using cron-like annotation
Apache License 2.0
529 stars 59 forks source link

Handling Job Recovery with tokio-cron-scheduler After Process Restart #84

Open dongbin86 opened 1 month ago

dongbin86 commented 1 month ago

I’m using tokio-cron-scheduler where job metadata and states are persisted in NATS, but the job execution logic seems to remain in memory. After restarting the process, I encountered the error: Error getting 679a9805-f852-43b3-9257-3fbf1c75c6c9 from job code.

Questions:

How can I ensure that jobs not yet executed can be resumed or rescheduled after a restart? Is there an existing mechanism to persist job execution logic, or do you recommend a pattern for recovery? It seems that only SimpleJobCode and SimpleNotificationCode are implemented. How can these code parts be restored?