Merge pull request #2156 from balena-os/jitter-docs

Add note regading API jitter on target state poll
This commit is contained in:
flowzone-app[bot] 2023-10-23 13:33:50 +00:00 committed by GitHub
commit cdec9ca34d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,6 +165,9 @@ const poll = async (
fetchErrors: number = 0,
): Promise<void> => {
// Add random jitter up to `maxApiJitterDelay` to space out poll requests
// NOTE: the jitter has as objective to reduce the load on networks that have
// devices on the 1000s. It's not meant to ease the load on the API as the backend performs
// other operations to deal with scaling issues
let pollInterval =
Math.random() * constants.maxApiJitterDelay + appUpdatePollInterval;