From 620b9715bb191e5f8048d3b15d2be58e205f3235 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 19 Nov 2018 10:59:58 -0200 Subject: [PATCH] IDEMPIERE-3823 Schedule without Schedule Type is running wild / implemented to run once on reboot --- .../main/server/org/compiere/server/AdempiereServer.java | 9 ++++++++- .../server/org/compiere/server/AdempiereServerMgr.java | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java index 9a94a79bfd..587e812f72 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServer.java @@ -297,10 +297,17 @@ public abstract class AdempiereServer implements Runnable p_model.getFrequency(), p_model.getCronPattern()); m_sleepMS = m_nextWork - now; + if (m_nextWork == 0) { + m_sleepMS = 0; + } if (log.isLoggable(Level.INFO)) log.info(" Next run: " + new Timestamp(m_nextWork) + " sleep " + m_sleepMS); // p_model.setDateLastRun(lastRun); - p_model.setDateNextRun(new Timestamp(m_nextWork)); + if (m_nextWork == 0) { + p_model.setDateNextRun(null); + } else { + p_model.setDateNextRun(new Timestamp(m_nextWork)); + } p_model.saveEx(); } // run diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java index 2065ae7f6e..790f1bba56 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java @@ -577,7 +577,9 @@ public class AdempiereServerMgr implements ServiceTrackerCustomizer