shjung пре 2 недеља
родитељ
комит
f750a0f6f4

+ 2 - 2
evps-comm-server/src/main/java/com/evps/comm/server/scheduler/ApplicationScheduler.java

@@ -57,12 +57,12 @@ public class ApplicationScheduler {
     }
 
     @Scheduled(cron = "0/30 * * * * *")
-    public void serviceMangerSchedule() {
+    public void checkServiceTimeout() {
         try {
             this.evpsServiceManagerService.checkServiceTimeout();
         }
         catch(Exception e) {
-            log.error("ApplicationScheduler.serviceMangerSchedule: Exception {}", e.getMessage());
+            log.error("ApplicationScheduler.checkServiceTimeout: Exception {}", e.getMessage());
         }
     }
 

+ 6 - 1
evps-comm-server/src/main/java/com/evps/comm/server/service/EvpsServiceManagerService.java

@@ -38,7 +38,9 @@ public class EvpsServiceManagerService {
         serviceMap.forEach((key, service) -> {
             String serviceId = service.getServiceId();
             EvpsCenter center = (EvpsCenter)service.getCenterObj();
-
+            if (center == null) {
+                return;
+            }
             long lastCommTime = service.getLastCommTime() / 1000L;
             if (currentTimeSeconds - lastCommTime >= timeoutMilliSeconds) {
 //                log.warn("[{}]. checkServiceTimeout: Service Id: {}, Last Comm Timeout: {} seconds.", center.getLogKey(), serviceId, (currentTimeSeconds - lastCommTime));
@@ -59,6 +61,9 @@ public class EvpsServiceManagerService {
             }
 
             EvpsCenter center = (EvpsCenter)service.getCenterObj();
+            if (center == null) {
+                continue;
+            }
 
             log.warn("[{}]. checkServiceTimeout: Service Id: {}, Service Auto Timeout: ClctDt: {}.", center.getLogKey(), serviceId, service.getClctDt());