Skip to content

Commit

Permalink
logging optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Xin Zheng committed Nov 7, 2024
1 parent 74ddb7e commit 9ad4ad0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/java/org/swisspush/redisques/RedisQues.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ private void initialize() {
registerActiveQueueRegistrationRefresh();
registerQueueCheck();
registerMetricsGathering(configuration);
registerNotexpiredQueueCheck();
registerNotExpiredQueueCheck();
}

private void registerNotexpiredQueueCheck() {
private void registerNotExpiredQueueCheck() {
vertx.setPeriodic(20 * 1000, event -> {
if (!log.isDebugEnabled()) {
return;
Expand All @@ -437,13 +437,16 @@ private void registerNotexpiredQueueCheck() {
}
Response keys = keysResult.result();
if (keys == null || keys.size() == 0) {
log.debug("No consumers found to reset");
log.debug("0 not expired consumers keys found");
return;
}
for (Response response : keys) {
log.debug(response.toString());

if (log.isTraceEnabled()) {
for (Response response : keys) {
log.trace(response.toString());
}
}
log.debug("Key list end");
log.debug("{} not expired consumers keys found", keys.size());
}))
.onFailure(throwable -> log.error("Redis: Unable to get redis keys of consumers", throwable));
});
Expand Down

0 comments on commit 9ad4ad0

Please sign in to comment.