Skip to content

Commit

Permalink
Replace scheduleAtFixedRate when evicting with scheduleWithFixedDelay…
Browse files Browse the repository at this point in the history
… for single object pool.

Signed-off-by: Kenneth J. Shackleton <[email protected]>
  • Loading branch information
kennethshackleton committed Jun 25, 2024
1 parent 2fbda51 commit 5a58997
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class SingleObjectPool<K : Any, T : IPooledObject<K>>(
}
}?.let {
factory.destroyObject(it)
attemptScheduleEviction()
}

@GuardedBy("mutex")
Expand All @@ -118,7 +119,7 @@ class SingleObjectPool<K : Any, T : IPooledObject<K>>(
if (evictionIntervalMillis < 0L || isClosed) {
return
}
future = executor.scheduleAtFixedRate(
future = executor.scheduleWithFixedDelay(
::evict,
evictionDelayMillis,
evictionIntervalMillis,
Expand Down

0 comments on commit 5a58997

Please sign in to comment.