Skip to content

Commit bcf3bad

Browse files
committed
Treat 503 as an expected authentication response
This avoids spamming error reports on a 503 and instead uses the auth failure delay mechanism which will reduce the load we create on the API and also on openvpn from reconnect attempts and help reduce subsequent 503s and other slowness Change-type: patch
1 parent 1f18bba commit bcf3bad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const checkDeviceAuth = memoize(
5353
url: `${BALENA_API_INTERNAL_HOST}/services/vpn/auth/${username}`,
5454
...getPassthrough(`Bearer ${password}`),
5555
});
56-
if ([200, 401, 403].includes(statusCode)) {
56+
if ([200, 401, 403, 503].includes(statusCode)) {
5757
return statusCode;
5858
}
5959
throw new Error(`Unexpected status code from the API: ${statusCode}`);

0 commit comments

Comments
 (0)