Skip to content

Commit

Permalink
Fix regression to hot-reloading of string based timer intervals.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwexler committed Nov 11, 2024
1 parent 7d740e7 commit 2505f8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/groovy/io/xh/hoist/util/Timer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class Timer implements LogSupport {
coreTimer.schedule((this.&onCoreTimer as TimerTask), delayMs, coreIntervalMs)

// Aux Timer for reloading dynamic intervals
if (interval instanceof Closure || timeout instanceof Closure) {
if (this.interval instanceof Closure || this.timeout instanceof Closure) {
configTimer = new java.util.Timer()
configTimer.schedule(
(this.&onConfigTimer as TimerTask), CONFIG_INTERVAL, CONFIG_INTERVAL
Expand Down Expand Up @@ -302,6 +302,7 @@ class Timer implements LogSupport {
intervalMs = calcIntervalMs()
timeoutMs = calcTimeoutMs()
adjustCoreTimerIfNeeded()
logInfo('intervalMs: ' + intervalMs)
} catch (Throwable t) {
logError('Timer failed to reload config', t)
}
Expand Down

0 comments on commit 2505f8a

Please sign in to comment.