mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
plugins/shutdown: fix triggerShutdown scheduling and response (#9276)
Earlier the triggerShutdown API would immediately shutdown the MS and if it is the same MS on which API is called it would lead to error in the API call. This change adds a delay to the process so the MS would be able to send response to the API. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
ae3fa5d0de
commit
097359bef9
@ -107,7 +107,10 @@ public class ShutdownManagerImpl extends ManagerBase implements ShutdownManager,
|
|||||||
this.shutdownTask = null;
|
this.shutdownTask = null;
|
||||||
}
|
}
|
||||||
this.shutdownTask = new ShutdownTask(this);
|
this.shutdownTask = new ShutdownTask(this);
|
||||||
timer.scheduleAtFixedRate(shutdownTask, 0, 30L * 1000);
|
long period = 30L * 1000;
|
||||||
|
long delay = period / 2;
|
||||||
|
logger.debug(String.format("Scheduling shutdown task with delay: %d and period: %d", delay, period));
|
||||||
|
timer.scheduleAtFixedRate(shutdownTask, delay, period);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user