mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 16:57:57 +00:00
Fix the "already delayed by" calculation
Change-type: patch
This commit is contained in:
parent
14f8bb7b3b
commit
32e3399f7c
@ -135,7 +135,7 @@ export class BalenaLogBackend extends LogBackend {
|
|||||||
MAX_COOLDOWN_PERIOD,
|
MAX_COOLDOWN_PERIOD,
|
||||||
);
|
);
|
||||||
// Work out how much of a delay has already occurred since the last attempt
|
// Work out how much of a delay has already occurred since the last attempt
|
||||||
const alreadyDelayedBy = this.lastSetupAttempt - Date.now();
|
const alreadyDelayedBy = Date.now() - this.lastSetupAttempt;
|
||||||
// The difference between the two is the actual delay we want
|
// The difference between the two is the actual delay we want
|
||||||
const delay = Math.max(totalDelay - alreadyDelayedBy, 0);
|
const delay = Math.max(totalDelay - alreadyDelayedBy, 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user