BAEL-6036: Enable caching on the TasksService for Lightrun Article (#13221)

This commit is contained in:
Graham Cox
2022-12-30 11:13:44 +00:00
committed by GitHub
parent 3ae92ff46c
commit bb73d0e86a
4 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package com.baeldung.tasksservice;
import java.util.List;
import org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.stereotype.Component;
@Component
public class SimpleCacheCustomizer implements CacheManagerCustomizer<ConcurrentMapCacheManager> {
@Override
public void customize(ConcurrentMapCacheManager cacheManager) {
cacheManager.setCacheNames(List.of("tasks"));
}
}