moqui / moqui-framework

Use Moqui Framework to build enterprise applications based on Java. It includes tools for databases (relational, graph, document), local and web services, web and other UI with screens and forms, security, file/resource access, scripts, templates, l10n, caching, logging, search, rules, workflow, multi-instance, and integration.
http://www.moqui.org
Other
279 stars 199 forks source link

When expiring lock, set lastRunTime to startTime of last successful jobRun (or null) #633

Open jenshp opened 3 months ago

jenshp commented 3 months ago

When a Job Run is interrupted and never ends (e.g. due to a server crash), moqui will at first wait for the expireLockTime specified in the Service Job. After that time, the lock will be cleared, but the lastRunTime would remain at the time the lock was acquired, which is interpreted as the las time the job was successfully run. This PR fixes this issue, setting the lastRunTime either back to the last successful Job Run, or null if there has not been one. This is the same behavior applied when moqui handles an error during the execution of the Job Run.

acetousk commented 3 months ago

I reviewed the code and this looks good to me.

See: https://forum.moqui.org/t/last-run-time-in-scheduledjobrunner/691/3