fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit f31b96d541 - Show all commits

View file

@ -1736,11 +1736,21 @@ export class SystemKeywords {
}); });
}; };
if (result.status === 429 || result.status === 401) { if (result.status === 401) {
GBLog.info(`Waiting 1min. before retrynig GET: ${url}.`); GBLog.info(`Waiting 5 secs. before retrynig HTTP 401 GET: ${url}`);
await sleep(5 * 1000);
throw new Error(`BASIC: HTTP:${result.status} retry: ${result.statusText}.`);
}
if (result.status === 429) {
GBLog.info(`Waiting 1min. before retrying HTTP 429 GET: ${url}`);
await sleep(60 * 1000); await sleep(60 * 1000);
throw new Error(`BASIC: HTTP:${result.status} retry: ${result.statusText}.`); throw new Error(`BASIC: HTTP:${result.status} retry: ${result.statusText}.`);
} }
if (result.status === 503) {
GBLog.info(`Waiting 1h before retrynig GET 503: ${url}`);
await sleep(60 * 60 * 1000);
throw new Error(`BASIC: HTTP:${result.status} retry: ${result.statusText}.`);
}
if (result.status === 2000) { if (result.status === 2000) {