Merge pull request #2360 from balena-os/memory-improvements

Memory usage improvements
This commit is contained in:
flowzone-app[bot] 2024-08-05 19:16:24 +00:00 committed by GitHub
commit b31cbf0db8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 14 additions and 15 deletions

13
package-lock.json generated
View File

@ -46,7 +46,7 @@
"balena-auth": "^6.0.1",
"balena-register-device": "^9.0.2",
"balena-request": "^13.3.1",
"blinking": "^0.0.8",
"blinking": "^1.0.1",
"bluebird": "^3.7.2",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
@ -3069,13 +3069,12 @@
}
},
"node_modules/blinking": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/blinking/-/blinking-0.0.8.tgz",
"integrity": "sha512-eQMWYzX6EP+FSKpmOVN4Z47vZGcBrstAszrIVG5WExDDZneicaEz3kBNfARI7FcZ+pxIrbRx2bkh7bR6HrfbqA==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/blinking/-/blinking-1.0.1.tgz",
"integrity": "sha512-ZvZBCqUBIKA0ZEpf00nLYHyR/7ge7XMwGi3nA7RcuoA6i5fIkFr3YtQ84ExPk0Q/s4FVWVeaM3TGPSJHpTDhjA==",
"dev": true,
"dependencies": {
"@types/bluebird": "^3.5.36",
"bluebird": "^3.7.2"
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/bluebird": {

View File

@ -72,7 +72,7 @@
"balena-auth": "^6.0.1",
"balena-register-device": "^9.0.2",
"balena-request": "^13.3.1",
"blinking": "^0.0.8",
"blinking": "^1.0.1",
"bluebird": "^3.7.2",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",

View File

@ -454,7 +454,7 @@ async function provisionOrRetry(retryDelay: number): Promise<void> {
delay: retryDelay,
});
await setTimeout(retryDelay);
return provisionOrRetry(retryDelay);
void provisionOrRetry(retryDelay);
}
}

View File

@ -174,8 +174,8 @@ const poll = async (
const delayedLoop = async (delayBy: number) => {
// Wait until we want to poll again
await setTimeout(delayBy);
// Poll again
await poll(false, fetchErrors);
// Poll again (use void to break recursion)
void poll(false, fetchErrors);
};
// Check if we want to skip first request and just loop again

View File

@ -267,7 +267,8 @@ export async function startReporting() {
// Wait until we want to report again
await setTimeout(delayBy);
// Try to report again
await recursivelyReport(delayBy);
// the void is necessary to break the recursion and avoid leaks
void recursivelyReport(delayBy);
}
}

View File

@ -759,7 +759,6 @@ export function triggerApplyTarget({
scheduledApply = null;
}
});
return null;
}
export async function applyIntermediateTarget(

View File

@ -88,6 +88,6 @@ export async function loadBackupFromMigration(
log.error(`Error restoring migration backup, retrying: ${err}`);
await setTimeout(retryDelay);
return loadBackupFromMigration(targetState, retryDelay);
void loadBackupFromMigration(targetState, retryDelay);
}
}

View File

@ -118,7 +118,7 @@ class LogMonitor {
}s`,
);
await setTimeout(wait);
return this.start();
void this.start();
}
public isAttached(containerId: string): boolean {