Skip to content

Commit cb3495e

Browse files
committed
review comments
1 parent ab9f3c5 commit cb3495e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,7 @@ boolean isClosed() {
20482048

20492049
// Does various pool maintenance activities.
20502050
void maintainPool() {
2051-
Instant currTime = clock.instant();
2051+
Instant currTime;
20522052
synchronized (lock) {
20532053
if (SessionPool.this.isClosed()) {
20542054
return;
@@ -2061,6 +2061,7 @@ void maintainPool() {
20612061
}
20622062
this.prevNumSessionsAcquired = SessionPool.this.numSessionsAcquired;
20632063

2064+
currTime = clock.instant();
20642065
// Reset the start time for recording the maximum number of sessions in the pool
20652066
if (currTime.isAfter(SessionPool.this.lastResetTime.plus(Duration.ofMinutes(10)))) {
20662067
SessionPool.this.maxSessionsInUse = SessionPool.this.numSessionsInUse;

0 commit comments

Comments
 (0)