Skip to content

Commit

Permalink
[SDCISA-13736, SDCISA-10974] Log less if lock already taken.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenalpha committed Jan 5, 2024
1 parent db495db commit c2dc144
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,14 @@ private void startPeriodicStorageCleanup(long intervalMs) {
vertx.setPeriodic(intervalMs, event -> lock.acquireLock(STORAGE_CLEANUP_TASK_LOCK,
token(STORAGE_CLEANUP_TASK_LOCK), lockExpiry(resourceCleanupIntervalSec))
.onComplete(lockEvent -> {
if( lockEvent.failed() || !lockEvent.result() ){
if( lockEvent.failed() ){
log.error("Could not acquire lock '{}'.", STORAGE_CLEANUP_TASK_LOCK, lockEvent.cause());
return;
}
if( !lockEvent.result() ){
log.debug("Lock already taken '{}'", STORAGE_CLEANUP_TASK_LOCK);
return;

Check warning on line 147 in src/main/java/org/swisspush/reststorage/redis/RedisStorage.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/swisspush/reststorage/redis/RedisStorage.java#L146-L147

Added lines #L146 - L147 were not covered by tests
}
cleanup(cleanupEvent -> {
if (cleanupEvent.error) {
log.warn("cleanup(): {}", cleanupEvent.errorMessage);
Expand Down

0 comments on commit c2dc144

Please sign in to comment.