Skip to content

Commit

Permalink
Eliminating shutdown noise from interruption in schedule tasks execut…
Browse files Browse the repository at this point in the history
…or. (#45)
  • Loading branch information
onukristo authored Jan 11, 2024
1 parent ff6e89a commit 46da61b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.12.3] - 2024-01-11

### Fixed

* Eliminating shutdown noise from interruption in schedule tasks executor.

## [1.12.2] - 2024-01-05

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.12.2
version=1.12.3
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,16 @@ public void start() {

executorService.submit(() -> {
while (!stopRequested) {
ScheduledTask scheduledTask = ExceptionUtils.doUnchecked(() -> taskQueue.poll(tick.toMillis(), TimeUnit.MILLISECONDS));
ScheduledTask scheduledTask = null;
try {
scheduledTask = taskQueue.poll(tick.toMillis(), TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
if (stopRequested) {
break;
} else {
throw new RuntimeException(e);
}
}
if (log.isDebugEnabled() && scheduledTask == null) {
if (nextTaskLoggingRateLimiter.tryAcquire()) {
var nextScheduledTask = taskQueue.peek();
Expand Down

0 comments on commit 46da61b

Please sign in to comment.