We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7671ae4 commit ce112c6Copy full SHA for ce112c6
src/ui/util/api.ts
@@ -1,13 +1,16 @@
1
-// src/api/index.js
2
import axios from 'axios';
3
import { useMemo } from 'react';
4
5
import { useAuth } from '@ui/components/AuthContext';
6
import { getRunEnvironmentConfig, ValidService } from '@ui/config';
7
+export const MAX_API_TIMEOUT_MS = 5000;
8
+
9
const createAxiosInstance = (baseURL: string) =>
10
axios.create({
11
baseURL,
12
+ timeout: MAX_API_TIMEOUT_MS,
13
+ timeoutErrorMessage: 'The request timed out.',
14
});
15
16
const useApi = (serviceName: ValidService) => {
0 commit comments