IDEMPIERE-3676 Incorrect stop of the schedulers (#280)
Base on patch from NikColonel<polkneket@gmail.com>
This commit is contained in:
commit
72e13cf1f4
|
@ -620,7 +620,11 @@ public abstract class SvrProcess implements ProcessCall
|
||||||
//save logging info even if context is lost
|
//save logging info even if context is lost
|
||||||
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,8 +730,10 @@ public class AdempiereServerMgr implements ServiceTrackerCustomizer<IServerFacto
|
||||||
public void run() {
|
public void run() {
|
||||||
if (server.isSleeping()) {
|
if (server.isSleeping()) {
|
||||||
server.run();
|
server.run();
|
||||||
if (server.getSleepMS() != 0) {
|
if (!isInterrupted()) {
|
||||||
scheduleFuture = Adempiere.getThreadPoolExecutor().schedule(this, server.getSleepMS(), TimeUnit.MILLISECONDS);
|
if (server.getSleepMS() != 0) {
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue