summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/monitoring
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-19 18:09:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-19 18:09:34 +0000
commitd4e22f4ade1ce4dfd54f4d1740f074b2be441705 (patch)
tree5f1f1bbe3c7673905804170bfd1becf665d4b0b5 /app/assets/javascripts/monitoring
parentc18599314d98c0aa4dfe7d56423469f0b641d066 (diff)
downloadgitlab-ce-d4e22f4ade1ce4dfd54f4d1740f074b2be441705.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/monitoring')
-rw-r--r--app/assets/javascripts/monitoring/requests/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/monitoring/requests/index.js b/app/assets/javascripts/monitoring/requests/index.js
index 26fedb9c81c..8b65eec051f 100644
--- a/app/assets/javascripts/monitoring/requests/index.js
+++ b/app/assets/javascripts/monitoring/requests/index.js
@@ -1,13 +1,16 @@
import axios from '~/lib/utils/axios_utils';
import { backOff } from '~/lib/utils/common_utils';
-import statusCodes from '~/lib/utils/http_status';
+import statusCodes, {
+ HTTP_STATUS_NO_CONTENT,
+ HTTP_STATUS_UNPROCESSABLE_ENTITY,
+} from '~/lib/utils/http_status';
import { PROMETHEUS_TIMEOUT } from '../constants';
const cancellableBackOffRequest = (makeRequestCallback) =>
backOff((next, stop) => {
makeRequestCallback()
.then((resp) => {
- if (resp.status === statusCodes.NO_CONTENT) {
+ if (resp.status === HTTP_STATUS_NO_CONTENT) {
next();
} else {
stop(resp);
@@ -34,7 +37,7 @@ export const getPrometheusQueryData = (prometheusEndpoint, params, opts) =>
const { response = {} } = error;
if (
response.status === statusCodes.BAD_REQUEST ||
- response.status === statusCodes.UNPROCESSABLE_ENTITY ||
+ response.status === HTTP_STATUS_UNPROCESSABLE_ENTITY ||
response.status === statusCodes.SERVICE_UNAVAILABLE
) {
const { data } = response;