Skip to content

Commit

Permalink
Add permanent ports caches
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Jan 14, 2025
1 parent b045446 commit 821f8a5
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ class CaffeineConfiguration {
val missionControlUnitsCache = buildMinutesCache(missionControlUnits, ticker, 120)

// Ports
val portsCache = buildMinutesCache(ports, ticker, oneWeek)
val activePortsCache = buildMinutesCache(activePorts, ticker, oneDay)
val portCache = buildMinutesCache(port, ticker, oneWeek)
val portsCache = buildPermanentCache(ports)
val activePortsCache = buildPermanentCache(activePorts)
val portCache = buildPermanentCache(port)

// Risk Factors
val riskFactorCache = buildMinutesCache(riskFactor, ticker, 1)
Expand Down Expand Up @@ -245,6 +245,17 @@ class CaffeineConfiguration {
)
}

private fun buildPermanentCache(
name: String,
): CaffeineCache {
return CaffeineCache(
name,
Caffeine.newBuilder()
.recordStats()
.build(),
)
}

private fun buildSecondsCache(
name: String,
ticker: Ticker,
Expand Down

0 comments on commit 821f8a5

Please sign in to comment.