mirror of
https://github.com/mozilla/fxa.git
synced 2025-12-13 20:36:41 +01:00
fix(nimbus): Update nimbus timeout to 500ms
This commit is contained in:
@@ -718,8 +718,8 @@ const conf = (module.exports = convict({
|
||||
format: String,
|
||||
},
|
||||
timeout: {
|
||||
default: 200,
|
||||
doc: 'Amount of time in milliseconds to wait for a response from cirrus',
|
||||
default: 400,
|
||||
doc: 'Amount of time in milliseconds to wait for a response from cirrus.',
|
||||
env: 'NIMBUS_CIRRUS_TIMEOUT',
|
||||
format: Number,
|
||||
},
|
||||
|
||||
@@ -60,22 +60,29 @@ module.exports = function (config, statsd) {
|
||||
statsd.increment('cirrus.experiment-fetch-success');
|
||||
}
|
||||
} catch (err) {
|
||||
Sentry.captureException(err, {
|
||||
tags: {
|
||||
source: 'nimbus-experiments',
|
||||
},
|
||||
});
|
||||
const isTimeout = err.name === 'AbortError' || err.name === 'TimeoutError';
|
||||
|
||||
if (statsd) {
|
||||
statsd.increment('cirrus.experiment-fetch-error');
|
||||
|
||||
if (isTimeout) {
|
||||
statsd.increment('cirrus.experiment-fetch-timeout');
|
||||
}
|
||||
}
|
||||
|
||||
if (!isTimeout) {
|
||||
Sentry.captureException(err, {
|
||||
tags: {
|
||||
source: 'nimbus-experiments',
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Return a 'service unavailable' error. We essentially failed
|
||||
// to communicate with the cirrus server, so experiments are
|
||||
// now unavailable...
|
||||
res.status(503);
|
||||
res.end();
|
||||
|
||||
// Record failure
|
||||
if (statsd) {
|
||||
statsd.increment('cirrus.experiment-fetch-error');
|
||||
}
|
||||
} finally {
|
||||
clearTimeout(timeoutId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user