Skip to content

Commit

Permalink
Log warning when threadpool for cache maintenance is null
Browse files Browse the repository at this point in the history
Signed-off-by: owenhalpert <ohalpert@gmail.com>
  • Loading branch information
owenhalpert committed Jan 10, 2025
1 parent a7e5ff4 commit 1a88678
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ private void initialize(NativeMemoryCacheManagerDto nativeMemoryCacheDTO) {
cacheCapacityReached = new AtomicBoolean(false);
accessRecencyQueue = new ConcurrentLinkedDeque<>();
cache = cacheBuilder.build();

if (threadPool != null) {
startMaintenance(cache);
} else {
logger.warn("ThreadPool is null during NativeMemoryCacheManager initialization. Maintenance will not be started.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ private void buildCache() {
)
.removalListener(this::onRemoval)
.build();

if (threadPool != null) {
startMaintenance(cache);
} else {
log.warn("ThreadPool is null during QuantizationStateCache initialization. Maintenance will not be started.");
}
}

Expand Down

0 comments on commit 1a88678

Please sign in to comment.