Skip to content

Commit

Permalink
add check for timeout isZero()
Browse files Browse the repository at this point in the history
  • Loading branch information
EddeCCC committed Dec 13, 2024
1 parent d948839 commit 1123a7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void startScheduledHandler() {
handlerFuture = executor.scheduleWithFixedDelay(this,
pollingInterval.toMillis(), pollingInterval.toMillis(), TimeUnit.MILLISECONDS);
// Setup timeout for fetching a command
if (pollingTimeout != null)
if (pollingTimeout != null && !pollingTimeout.isZero())
timeoutExecutor.scheduleCancelling(handlerFuture, "agentcommand", this::startScheduledHandler, pollingTimeout);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void startScheduledPolling() {
pollerFuture = executor.scheduleWithFixedDelay(this,
pollingInterval.toMillis(), pollingInterval.toMillis(), TimeUnit.MILLISECONDS);
// Setup timeout for fetching the configuration
if (pollingTimeout != null)
if (pollingTimeout != null && !pollingTimeout.isZero())
timeoutExecutor.scheduleCancelling(pollerFuture, "http.config", this::startScheduledPolling, pollingTimeout);
}

Expand Down

0 comments on commit 1123a7a

Please sign in to comment.