Skip to content

Commit

Permalink
chore(logging): log messages around cache refresh (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
emjburns authored Nov 1, 2018
1 parent 9a9b37b commit 6154d35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ open class EddaImagesUsedByInstancesProvider(
private val log: Logger = LoggerFactory.getLogger(javaClass)

override fun load(): AmazonImagesUsedByInstancesCache {
log.info("Loading cache for ${javaClass.simpleName}")
val refdAmisByRegion = mutableMapOf<String, Set<String>>()

val regions = workConfigurations.asSequence()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ open class EddaLaunchConfigurationCacheProvider(
private val log: Logger = LoggerFactory.getLogger(javaClass)

override fun load(): AmazonLaunchConfigurationCache {
log.info("Loading cache for ${javaClass.simpleName}")
val configsByRegion = mutableMapOf<String, Set<AmazonLaunchConfiguration>>()
val refdAmisByRegion = mutableMapOf<String, MutableMap<String, MutableSet<AmazonLaunchConfiguration>>>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ open class InMemoryCache<out T : Cacheable>(
@Scheduled(fixedDelay = 15 * 60 * 1000L) //TODO: make configurable
private fun refresh() {
try {
log.info("Refreshing cache ${javaClass.name}")
cache.set(source)
} catch (e: Exception) {
log.error("Error refreshing cache ${javaClass.name}", e)
Expand Down Expand Up @@ -73,6 +74,7 @@ open class InMemorySingletonCache<out T : Cacheable>(
@Scheduled(fixedDelay = 15 * 60 * 1000L) //TODO: make configurable
private fun refresh() {
try {
log.info("Refreshing cache ${javaClass.name}")
cache.set(source)
} catch (e: Exception) {
log.error("Error refreshing cache ${javaClass.name}", e)
Expand Down

0 comments on commit 6154d35

Please sign in to comment.