IDEMPIERE-3676 Incorrect stop of the schedulers (#280)
Base on patch from NikColonel<polkneket@gmail.com>
This commit is contained in:
commit
72e13cf1f4
|
@ -621,6 +621,10 @@ public abstract class SvrProcess implements ProcessCall
|
||||||
if (noContext)
|
if (noContext)
|
||||||
Env.getCtx().put("#AD_Client_ID", m_pi.getAD_Client_ID());
|
Env.getCtx().put("#AD_Client_ID", m_pi.getAD_Client_ID());
|
||||||
|
|
||||||
|
//clear interrupt signal so that we can unlock the ad_pinstance record
|
||||||
|
if (Thread.currentThread().isInterrupted())
|
||||||
|
Thread.interrupted();
|
||||||
|
|
||||||
MPInstance mpi = new MPInstance (getCtx(), m_pi.getAD_PInstance_ID(), null);
|
MPInstance mpi = new MPInstance (getCtx(), m_pi.getAD_PInstance_ID(), null);
|
||||||
if (mpi.get_ID() == 0)
|
if (mpi.get_ID() == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -730,9 +730,11 @@ public class AdempiereServerMgr implements ServiceTrackerCustomizer<IServerFacto
|
||||||
public void run() {
|
public void run() {
|
||||||
if (server.isSleeping()) {
|
if (server.isSleeping()) {
|
||||||
server.run();
|
server.run();
|
||||||
|
if (!isInterrupted()) {
|
||||||
if (server.getSleepMS() != 0) {
|
if (server.getSleepMS() != 0) {
|
||||||
scheduleFuture = Adempiere.getThreadPoolExecutor().schedule(this, server.getSleepMS(), TimeUnit.MILLISECONDS);
|
scheduleFuture = Adempiere.getThreadPoolExecutor().schedule(this, server.getSleepMS(), TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//server busy, try again after one minute
|
//server busy, try again after one minute
|
||||||
scheduleFuture = Adempiere.getThreadPoolExecutor().schedule(this, 60 * 1000, TimeUnit.MILLISECONDS);
|
scheduleFuture = Adempiere.getThreadPoolExecutor().schedule(this, 60 * 1000, TimeUnit.MILLISECONDS);
|
||||||
|
|
Loading…
Reference in New Issue