snap-admin icon indicating copy to clipboard operation
snap-admin copied to clipboard

Scheduling and Cron Jobs

Open aileftech opened this issue 2 years ago • 4 comments

The feedback wanted issues are ideas for possible features that I would like to have a feedback on before starting to implement. If you are interested in this features, please leave a reaction or a comment so I understand what features to prioritize.

Scheduling and Cron Jobs

Provide tools for scheduling tasks and running cron jobs (SQL scripts).

aileftech avatar Oct 25 '23 18:10 aileftech

I used quartz scheduler for crons, but there is the issue that the application might be clustered, so you have to provide a mechanism to place a DB lock (so that the job is not run by all instances in parallel).

There is not an "official" way to place a DB lock for spring, so different projects will use different implementations.

I think if this feature is not critical, it is better to be omitted, since different projects might want to use snap-admin, but already have an existent mechanism for running cron jobs, that might be different than the one used in snap-admin.

I like the concept of doing one thing very good (exposing a CRUD interface for the entities), so that all kinds of projects can use it without adding additional functionality.

a13a avatar Nov 01 '23 17:11 a13a

Hi, and thanks for this feedback!

Yes, I actually agree with this. It's a bit out of scope for this project and has too many "issues" to be implemented reliably. I wouldn't implement this as of now unless it received massive support.

aileftech avatar Nov 02 '23 08:11 aileftech

Eventually it could be implemented like an "action" button, that would trigger an external interface, so that the cron would be decoupled from the admin, and if somebody already has an implementation they could use their existing implementation.

a13a avatar Nov 02 '23 15:11 a13a

If you decide to go implement it, there is a relatively lightweight and most importantly very configurable tool for cluster aware scheduled jobs in spring - https://github.com/lukas-krecan/ShedLock

maciejwalkowiak avatar Nov 06 '23 22:11 maciejwalkowiak