Repository navigation
Manage cron schedules in runtime #299
|
@janbjorge Is there an option to manage cron schedules in runtime? For example in case if it is required to add new schedule via API request which would not require From what I see in current implementation - that is not possible since schedules are stored in worker memory and used to pull upcoming schedules from database. |
Replies: 1 comment
|
As of now, I don’t think it’s possible to manage cron schedules dynamically at runtime. However, it’s an interesting idea! I believe the reason I made For example, if two different cron expressions were defined for the same entry point:
These considerations add a layer of complexity to the runtime behavior, which is likely why I opted for the current design. Revisiting this with fresh eyes could open up interesting possibilities. Another thing to consider is how 'new' code would be loaded and executed for dynamically added schedules. Since workers load the code for entry points at startup, adding a new schedule via an API raises questions like:
These challenges highlight the trade-offs in introducing dynamic schedule management—it adds flexibility but also complexity to the system. That said, it’s definitely a feature worth exploring if runtime schedule updates become a priority. Thanks for bringing this up! |
As of now, I don’t think it’s possible to manage cron schedules dynamically at runtime. However, it’s an interesting idea! I believe the reason I made
(entrypoint, expression)unique might have been to avoid the complexity of handling overlapping crontabs for the same entry point.For example, if two different cron expressions were defined for the same entry point:
These considerations add a layer of complexity to the runtime behavior, which is likely why I opted for the current design. Revisiting this with fresh eyes could open up interesting possibilities.
Another …