From 8067233d8e78f9769377211af02f97c22fa01be4 Mon Sep 17 00:00:00 2001 From: Jan Bernitt Date: Tue, 14 Jan 2025 15:31:47 +0100 Subject: [PATCH] fix: prevent accidental job revert of a RUNNING job [DHIS2-18752] (#19652) --- .../org/hisp/dhis/scheduling/HibernateJobConfigurationStore.java | 1 + 1 file changed, 1 insertion(+) diff --git a/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/scheduling/HibernateJobConfigurationStore.java b/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/scheduling/HibernateJobConfigurationStore.java index d7db1f60b56..fbfb39ea9af 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/scheduling/HibernateJobConfigurationStore.java +++ b/dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/scheduling/HibernateJobConfigurationStore.java @@ -514,6 +514,7 @@ public boolean tryRevertNow(@Nonnull String jobId) { else schedulingtype end where jobstatus = 'RUNNING' and uid = :id + and now() > jobconfiguration.lastalive + interval '1 minute' """; return nativeSynchronizedQuery(sql).setParameter("id", jobId).executeUpdate() > 0; }