Skip to content

Commit

Permalink
feat(lapis2): clear cache when SILO crashed
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed May 16, 2024
1 parent eb75391 commit 3b72dcc
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.genspectrum.lapis.scheduler

import mu.KotlinLogging
import org.genspectrum.lapis.response.InfoData
import org.genspectrum.lapis.silo.CachedSiloClient
import org.genspectrum.lapis.silo.SILO_QUERY_CACHE_NAME
import org.genspectrum.lapis.silo.SiloUnavailableException
import org.springframework.cache.annotation.CacheEvict
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Component
Expand All @@ -24,6 +26,11 @@ class DataVersionCacheInvalidator(

val info = try {
cachedSiloClient.callInfo()
} catch (e: SiloUnavailableException) {
log.debug { "Caught ${SiloUnavailableException::class.java} $e" }
InfoData(
dataVersion = "currently unavailable",
)
} catch (e: Exception) {
log.debug { "Failed to call info: $e" }
return
Expand Down

0 comments on commit 3b72dcc

Please sign in to comment.