Refresh server startup time when recovery from waiting (#11595)
This commit is contained in:
parent
17a9dd25fa
commit
c110f4acae
|
|
@ -24,6 +24,12 @@ public class ServerLifeCycleManager {
|
|||
|
||||
private static volatile ServerStatus serverStatus = ServerStatus.RUNNING;
|
||||
|
||||
private static long serverStartupTime = System.currentTimeMillis();
|
||||
|
||||
public static long getServerStartupTime() {
|
||||
return serverStartupTime;
|
||||
}
|
||||
|
||||
public static boolean isRunning() {
|
||||
return serverStatus == ServerStatus.RUNNING;
|
||||
}
|
||||
|
|
@ -61,6 +67,7 @@ public class ServerLifeCycleManager {
|
|||
if (serverStatus != ServerStatus.WAITING) {
|
||||
throw new ServerLifeCycleException("The current server status is not waiting, cannot recover form waiting");
|
||||
}
|
||||
serverStartupTime = System.currentTimeMillis();
|
||||
serverStatus = ServerStatus.RUNNING;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ public class HeartBeatTask implements Runnable {
|
|||
if (!ServerLifeCycleManager.isRunning()) {
|
||||
return;
|
||||
}
|
||||
heartBeat.setStartupTime(ServerLifeCycleManager.getServerStartupTime());
|
||||
// update waiting task count
|
||||
heartBeat.setWorkerWaitingTaskCount(workerWaitingTaskCount);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue