feat: add backend status down indicator (#3889)

This commit is contained in:
Nigel Huang
2020-06-15 10:59:28 -04:00
committed by GitHub
parent 2b01e009c6
commit a50edc7055
12 changed files with 165 additions and 40 deletions

View File

@ -141,7 +141,10 @@ export interface Implementation {
) => Promise<{ entries: ImplementationEntry[]; cursor: Cursor }>;
isGitBackend?: () => boolean;
status: () => Promise<{ auth: boolean }>;
status: () => Promise<{
auth: { status: boolean };
api: { status: boolean; statusPage: string };
}>;
}
const MAX_CONCURRENT_DOWNLOADS = 10;

View File

@ -12,7 +12,7 @@ const isAbortControllerSupported = () => {
const timeout = 60;
const fetchWithTimeout = (input, init) => {
if (init.signal || !isAbortControllerSupported()) {
if ((init && init.signal) || !isAbortControllerSupported()) {
return fetch(input, init);
}
const controller = new AbortController();