Skip to content

Commit

Permalink
use hardcoded caffeine cache names. fixes cache configuration bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Jan 8, 2024
1 parent 116f007 commit a7f7642
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/main/java/io/cryostat/ConfigProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ public class ConfigProperties {
public static final String REPORTS_SIDECAR_URL = "cryostat.services.reports.url";
public static final String MEMORY_CACHE_ENABLED =
"cryostat.services.reports.memory-cache.enabled";
public static final String ACTIVE_REPORTS_MEMORY_CACHE_NAME =
"cryostat.services.reports.memory-cache.active.name";
public static final String ARCHIVED_REPORTS_MEMORY_CACHE_NAME =
"cryostat.services.reports.memory-cache.archived.name";
public static final String STORAGE_CACHE_ENABLED =
"cryostat.services.reports.storage-cache.enabled";
public static final String ARCHIVED_REPORTS_STORAGE_CACHE_NAME =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class MemoryCachingReportsListener {
boolean memoryCache;

@Inject
@CacheName(ConfigProperties.ACTIVE_REPORTS_MEMORY_CACHE_NAME)
@CacheName(MemoryCachingReportsService.ACTIVE_REPORTS_MEMORY_CACHE_NAME)
Cache activeCache;

@Inject
@CacheName(ConfigProperties.ARCHIVED_REPORTS_MEMORY_CACHE_NAME)
@CacheName(MemoryCachingReportsService.ARCHIVED_REPORTS_MEMORY_CACHE_NAME)
Cache archivedCache;

@Inject RecordingHelper recordingHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,21 @@
@Dependent
class MemoryCachingReportsService implements ReportsService {

static final String ACTIVE_REPORTS_MEMORY_CACHE_NAME = "activereports";
static final String ARCHIVED_REPORTS_MEMORY_CACHE_NAME = "archivedreports";

@ConfigProperty(name = "quarkus.cache.enabled")
boolean quarkusCache;

@ConfigProperty(name = ConfigProperties.MEMORY_CACHE_ENABLED)
boolean memoryCache;

@Inject
@CacheName(ConfigProperties.ACTIVE_REPORTS_MEMORY_CACHE_NAME)
@CacheName(ACTIVE_REPORTS_MEMORY_CACHE_NAME)
Cache activeCache;

@Inject
@CacheName(ConfigProperties.ARCHIVED_REPORTS_MEMORY_CACHE_NAME)
@CacheName(ARCHIVED_REPORTS_MEMORY_CACHE_NAME)
Cache archivedCache;

@Inject @Delegate @Any ReportsService delegate;
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ cryostat.messaging.queue.size=1024
cryostat.services.reports.url=
quarkus.cache.enabled=true
cryostat.services.reports.memory-cache.enabled=true
cryostat.services.reports.memory-cache.active.name=activereports
quarkus.cache.caffeine."activereports".expire-after-write=10s
cryostat.services.reports.memory-cache.archived.name=archivedreports
quarkus.cache.caffeine."archivedreports".expire-after-access=10m
cryostat.services.reports.storage-cache.enabled=true
cryostat.services.reports.storage-cache.name=archivedreports
Expand Down

0 comments on commit a7f7642

Please sign in to comment.