up timeout for now + don't log

Replays have issues since they are on v1 and timeout. This process needs to be improved on the backend.

don't log all
This commit is contained in:
Thomas Zarebczan 2022-05-05 12:29:14 -04:00
parent f191cf0b88
commit c6856da247
No known key found for this signature in database
GPG key ID: 767B41E1BB7346F2

View file

@ -1,5 +1,5 @@
// @flow // @flow
import analytics from 'analytics'; // import analytics from 'analytics';
import { FETCH_TIMEOUT } from 'constants/errors'; import { FETCH_TIMEOUT } from 'constants/errors';
import { NO_AUTH, X_LBRY_AUTH_TOKEN } from 'constants/token'; import { NO_AUTH, X_LBRY_AUTH_TOKEN } from 'constants/token';
import fetchWithTimeout from 'util/fetch'; import fetchWithTimeout from 'util/fetch';
@ -306,7 +306,7 @@ export function apiCall(method: string, params: ?{}, resolve: Function, reject:
? Lbry.alternateConnectionString ? Lbry.alternateConnectionString
: Lbry.daemonConnectionString; : Lbry.daemonConnectionString;
const SDK_FETCH_TIMEOUT_MS = 60000; const SDK_FETCH_TIMEOUT_MS = 1800000;
return fetchWithTimeout(SDK_FETCH_TIMEOUT_MS, fetch(connectionString + '?m=' + method, options)) return fetchWithTimeout(SDK_FETCH_TIMEOUT_MS, fetch(connectionString + '?m=' + method, options))
.then((response) => checkAndParse(response, method)) .then((response) => checkAndParse(response, method))
.then((response) => { .then((response) => {
@ -322,7 +322,7 @@ export function apiCall(method: string, params: ?{}, resolve: Function, reject:
.catch((err) => { .catch((err) => {
ApiFailureMgr.logFailure(method, params, counter); ApiFailureMgr.logFailure(method, params, counter);
if (err?.message === FETCH_TIMEOUT) { if (err?.message === FETCH_TIMEOUT) {
analytics.error(`${method}: timed out after ${SDK_FETCH_TIMEOUT_MS / 1000}s`); // analytics.error(`${method}: timed out after ${SDK_FETCH_TIMEOUT_MS / 1000}s`);
reject(resolveFetchErrorMsg(method, FETCH_TIMEOUT)); reject(resolveFetchErrorMsg(method, FETCH_TIMEOUT));
} else { } else {
reject(err); reject(err);