X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Frepository%2FService.java;h=f0863a5ee7e44f709f47da111f612ee2540def6a;hb=6503abc50ae627b59674a3dba6c59f5d41a02a41;hp=bcdc2ee0666aa4aaf79b9ad6fa06958c6a6932c8;hpb=eeaabb5364f23818dda5d10e0a7f30396bb981f4;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/repository/Service.java b/policy-agent/src/main/java/org/oransc/policyagent/repository/Service.java index bcdc2ee0..f0863a5e 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/repository/Service.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/repository/Service.java @@ -43,12 +43,12 @@ public class Service { return this.keepAliveInterval; } - private synchronized void ping() { + public synchronized void ping() { this.lastPing = Instant.now(); } public synchronized boolean isExpired() { - return timeSinceLastPing().compareTo(this.keepAliveInterval) > 0; + return this.keepAliveInterval.getSeconds() > 0 && timeSinceLastPing().compareTo(this.keepAliveInterval) > 0; } public synchronized Duration timeSinceLastPing() {