Skip to content

Commit 8b4a180

Browse files
committed
Improve logging
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
1 parent 32dcf85 commit 8b4a180

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/groovy/io/seqera/wave/store/cache/AbstractTieredCache.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ abstract class AbstractTieredCache<V extends MoshiExchange> implements TieredCac
221221
// use the loader function to fetch the value
222222
V value = null
223223
if( loader!=null ) {
224-
if( log.isTraceEnabled() )
224+
if( entry && needsRevalidation )
225+
log.debug "Cache '${name}' invoking loader - entry=$entry needs refresh"
226+
else if( log.isTraceEnabled() )
225227
log.trace "Cache '${name}' invoking loader - key=$key"
226228
final ret = loader.apply(key)
227229
value = ret?.v1
@@ -290,7 +292,6 @@ abstract class AbstractTieredCache<V extends MoshiExchange> implements TieredCac
290292
}
291293

292294
protected boolean shouldRevalidate(long expiration, Instant time=Instant.now()) {
293-
294295
// when 'remainingCacheTime' is less than or equals to zero, it means
295296
// the current time is beyond the expiration time, therefore a cache validation is needed
296297
final remainingCacheTime = expiration - time.toEpochMilli()

0 commit comments

Comments
 (0)