Skip to content

Commit

Permalink
move to debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
sonus21 committed May 16, 2021
1 parent f8bf0f7 commit 76b5f83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public List<RqueueMessage> popN(
String processingChannelName,
long visibilityTimeout,
int count) {
if (count < Constants.MIN_BATCH_SIZE) {
throw new IllegalArgumentException(
"Count must be greater than or equal to " + Constants.MIN_BATCH_SIZE);
}
long currentTime = System.currentTimeMillis();
RedisScript<List<RqueueMessage>> script = getScript(ScriptType.DEQUEUE_MESSAGE);
return scriptExecutor.execute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ boolean shouldExit() {
protected int getBatchSize(QueueDetail queueDetail, QueueThreadPool queueThreadPool) {
int batchSize = Math.min(queueDetail.getBatchSize(), queueThreadPool.availableThreads());
batchSize = Math.max(batchSize, Constants.MIN_BATCH_SIZE);
log(Level.INFO, "Batch size {}", null, batchSize);
log(Level.DEBUG, "Batch size {}", null, batchSize);
return batchSize;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public void release(int n) {
}

public boolean acquire(int n, long timeout) throws InterruptedException {
if (taskExecutor instanceof ThreadPoolTaskExecutor) {
if (log.isDebugEnabled() && taskExecutor instanceof ThreadPoolTaskExecutor) {
ThreadPoolTaskExecutor executor = ((ThreadPoolTaskExecutor) taskExecutor);
log.info("Current active threads {}", executor.getActiveCount());
log.debug("Current active threads {}", executor.getActiveCount());
}
return semaphore.tryAcquire(n, timeout, TimeUnit.MILLISECONDS);
}
Expand Down

0 comments on commit 76b5f83

Please sign in to comment.