mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Website: Update Vanta integration script to retry failed requests to Vanta's authorization endpoint. (#17704)
Changes: - Chained a `.retry()` onto the post request that refreshes authorization tokens for Vanta connections, that will retry requests that return a `503 service unavailable` response.
This commit is contained in:
parent
26965c8ae9
commit
d7783286d3
4
website/scripts/send-data-to-vanta.js
vendored
4
website/scripts/send-data-to-vanta.js
vendored
@ -34,7 +34,9 @@ module.exports = {
|
||||
grant_type: 'refresh_token',// eslint-disable-line camelcase
|
||||
},
|
||||
headers: { accept: 'application/json' }
|
||||
}).tolerate((err)=>{
|
||||
})
|
||||
.retry({raw:{statusCode: 503}})
|
||||
.tolerate((err)=>{
|
||||
// If an error occurs while sending a request to Vanta, we'll add the error to the errorReportById object, with this connections ID set as the key.
|
||||
errorReportById[connectionIdAsString] = new Error(`Could not refresh the token for Vanta connection (id: ${connectionIdAsString}). Full error: ${err}`);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user