Merge pull request #1846 from balena-os/fix-already-delayed-by

Fix the "already delayed by" calculation
This commit is contained in:
bulldozer-balena[bot] 2021-12-10 16:35:37 +00:00 committed by GitHub
commit ab59a18534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,7 +135,7 @@ export class BalenaLogBackend extends LogBackend {
MAX_COOLDOWN_PERIOD,
);
// 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
const delay = Math.max(totalDelay - alreadyDelayedBy, 0);