IDEMPIERE-3823 Schedule without Schedule Type is running wild / implemented to run once on reboot
This commit is contained in:
parent
28171cda7a
commit
620b9715bb
|
@ -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);
|
||||
if (m_nextWork == 0) {
|
||||
p_model.setDateNextRun(null);
|
||||
} else {
|
||||
p_model.setDateNextRun(new Timestamp(m_nextWork));
|
||||
}
|
||||
p_model.saveEx();
|
||||
} // run
|
||||
|
||||
|
|
|
@ -577,7 +577,9 @@ public class AdempiereServerMgr implements ServiceTrackerCustomizer<IServerFacto
|
|||
public void run() {
|
||||
if (server.isSleeping()) {
|
||||
server.run();
|
||||
if (server.getSleepMS() != 0) {
|
||||
scheduleFuture = Adempiere.getThreadPoolExecutor().schedule(this, server.getSleepMS(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
} else {
|
||||
//server busy, try again after one minute
|
||||
scheduleFuture = Adempiere.getThreadPoolExecutor().schedule(this, 60 * 1000, TimeUnit.MILLISECONDS);
|
||||
|
|
Loading…
Reference in New Issue