Skip to content

Commit c736ae2

Browse files
committed
Variable fixup
1 parent 35749cb commit c736ae2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/controller/controller_variables.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ namespace Controller{
7474
uint32_t interval = varAccX.getInt(fInterval, i);
7575
uint64_t lastRun = varAccX.getInt(fLastRun, i);
7676
uint32_t waitTime = varAccX.getInt(fWaitTime, i);
77-
if (!lastRun || (interval && (lastRun + interval < now))) {
77+
if (!lastRun || (interval && (lastRun + interval <= now))) {
7878
// Set the wait time to the interval, or 1 second if it is less than 1 second
7979
if (!waitTime) { waitTime = interval; }
8080
if (waitTime < 1000) { waitTime = 1000; }
8181
if (!runVariableTarget(name, target, waitTime)) {
8282
if (interval && now + interval < nextCheck) { nextCheck = now + interval; }
8383
}
8484
} else {
85+
// Set the wait time to the next run for this variable (if less than current wait time)
8586
if (interval && lastRun + interval < nextCheck) { nextCheck = lastRun + interval; }
8687
}
8788
}

0 commit comments

Comments
 (0)