feat: make cooldown optional and remove it from simple config
This commit is contained in:
1 parent
9401202575
commit
70ad2e8677
4 files changed
+3
-5
No files matched your search
+1
-1
@@ -331,7 +331,7 @@ const Worker = {
|
||||
// Allow for a cooldown period before writing to KV
|
||||
if (
|
||||
statusChanged ||
|
||||
currentTimeSecond - state.lastUpdate >= workerConfig.kvWriteCooldownMinutes * 60 - 10 // Allow for 10 seconds of clock drift
|
||||
currentTimeSecond - state.lastUpdate >= (workerConfig.kvWriteCooldownMinutes ?? 3) * 60 - 10 // Allow for 10 seconds of clock drift
|
||||
) {
|
||||
console.log('Updating state...')
|
||||
state.lastUpdate = currentTimeSecond
|
||||
|
||||
Reference in new issue
Block a user