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