aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
index fc0a887cf0e..64b757037d0 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
@@ -88,6 +88,7 @@ public class SessionRepository {
private final Path sessionsPath;
private final TenantName tenantName;
private final GlobalComponentRegistry componentRegistry;
+ private final SessionCounter sessionCounter;
public SessionRepository(TenantName tenantName,
GlobalComponentRegistry componentRegistry,
@@ -95,6 +96,7 @@ public class SessionRepository {
SessionPreparer sessionPreparer) {
this.tenantName = tenantName;
this.componentRegistry = componentRegistry;
+ sessionCounter = new SessionCounter(componentRegistry.getConfigCurator(), tenantName);
this.sessionsPath = TenantRepository.getSessionsPath(tenantName);
this.clock = componentRegistry.getClock();
this.curator = componentRegistry.getCurator();
@@ -655,7 +657,7 @@ public class SessionRepository {
}
private long getNextSessionId() {
- return new SessionCounter(componentRegistry.getConfigCurator(), tenantName).nextSessionId();
+ return sessionCounter.nextSessionId();
}
public Path getSessionPath(long sessionId) {