Expand timeout for relayers

This commit is contained in:
Tornado Contrib 2024-10-08 00:04:01 +00:00
parent fb33815290
commit 0ebd4d175f
Signed by: tornadocontrib
GPG Key ID: 60B4DF1A076C64B1
6 changed files with 21 additions and 21 deletions

12
dist/index.js vendored

@ -2805,7 +2805,7 @@ class RelayerClient {
url, url,
relayerAddress relayerAddress
}) { }) {
var _a, _b; var _a;
if (!url && hostname) { if (!url && hostname) {
url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`; url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
} else if (url && !url.endsWith("/")) { } else if (url && !url.endsWith("/")) {
@ -2817,8 +2817,8 @@ class RelayerClient {
headers: { headers: {
"Content-Type": "application/json, application/x-www-form-urlencoded" "Content-Type": "application/json, application/x-www-form-urlencoded"
}, },
timeout: ((_a = this.fetchDataOptions) == null ? void 0 : _a.torPort) ? 1e4 : 3e3, timeout: 6e4,
maxRetry: ((_b = this.fetchDataOptions) == null ? void 0 : _b.torPort) ? 2 : 0 maxRetry: ((_a = this.fetchDataOptions) == null ? void 0 : _a.torPort) ? 2 : 0
})); }));
const statusValidator = ajv.compile(getStatusSchema(this.netId, this.config, this.tovarish)); const statusValidator = ajv.compile(getStatusSchema(this.netId, this.config, this.tovarish));
if (!statusValidator(rawStatus)) { if (!statusValidator(rawStatus)) {
@ -3585,14 +3585,14 @@ function getTovarishNetworks(registryService, relayers) {
return __async$c(this, null, function* () { return __async$c(this, null, function* () {
yield Promise.all( yield Promise.all(
relayers.filter((r) => r.tovarishHost).map((relayer) => __async$c(this, null, function* () { relayers.filter((r) => r.tovarishHost).map((relayer) => __async$c(this, null, function* () {
var _a, _b; var _a;
try { try {
relayer.tovarishNetworks = yield fetchData(relayer.tovarishHost, __spreadProps$1(__spreadValues$2({}, registryService.fetchDataOptions), { relayer.tovarishNetworks = yield fetchData(relayer.tovarishHost, __spreadProps$1(__spreadValues$2({}, registryService.fetchDataOptions), {
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/json"
}, },
timeout: ((_a = registryService.fetchDataOptions) == null ? void 0 : _a.torPort) ? 1e4 : 3e3, timeout: 6e4,
maxRetry: ((_b = registryService.fetchDataOptions) == null ? void 0 : _b.torPort) ? 2 : 0 maxRetry: ((_a = registryService.fetchDataOptions) == null ? void 0 : _a.torPort) ? 2 : 0
})); }));
} catch (e) { } catch (e) {
relayer.tovarishNetworks = []; relayer.tovarishNetworks = [];

12
dist/index.mjs vendored

@ -2784,7 +2784,7 @@ class RelayerClient {
url, url,
relayerAddress relayerAddress
}) { }) {
var _a, _b; var _a;
if (!url && hostname) { if (!url && hostname) {
url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`; url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
} else if (url && !url.endsWith("/")) { } else if (url && !url.endsWith("/")) {
@ -2796,8 +2796,8 @@ class RelayerClient {
headers: { headers: {
"Content-Type": "application/json, application/x-www-form-urlencoded" "Content-Type": "application/json, application/x-www-form-urlencoded"
}, },
timeout: ((_a = this.fetchDataOptions) == null ? void 0 : _a.torPort) ? 1e4 : 3e3, timeout: 6e4,
maxRetry: ((_b = this.fetchDataOptions) == null ? void 0 : _b.torPort) ? 2 : 0 maxRetry: ((_a = this.fetchDataOptions) == null ? void 0 : _a.torPort) ? 2 : 0
})); }));
const statusValidator = ajv.compile(getStatusSchema(this.netId, this.config, this.tovarish)); const statusValidator = ajv.compile(getStatusSchema(this.netId, this.config, this.tovarish));
if (!statusValidator(rawStatus)) { if (!statusValidator(rawStatus)) {
@ -3564,14 +3564,14 @@ function getTovarishNetworks(registryService, relayers) {
return __async$c(this, null, function* () { return __async$c(this, null, function* () {
yield Promise.all( yield Promise.all(
relayers.filter((r) => r.tovarishHost).map((relayer) => __async$c(this, null, function* () { relayers.filter((r) => r.tovarishHost).map((relayer) => __async$c(this, null, function* () {
var _a, _b; var _a;
try { try {
relayer.tovarishNetworks = yield fetchData(relayer.tovarishHost, __spreadProps$1(__spreadValues$2({}, registryService.fetchDataOptions), { relayer.tovarishNetworks = yield fetchData(relayer.tovarishHost, __spreadProps$1(__spreadValues$2({}, registryService.fetchDataOptions), {
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/json"
}, },
timeout: ((_a = registryService.fetchDataOptions) == null ? void 0 : _a.torPort) ? 1e4 : 3e3, timeout: 6e4,
maxRetry: ((_b = registryService.fetchDataOptions) == null ? void 0 : _b.torPort) ? 2 : 0 maxRetry: ((_a = registryService.fetchDataOptions) == null ? void 0 : _a.torPort) ? 2 : 0
})); }));
} catch (e) { } catch (e) {
relayer.tovarishNetworks = []; relayer.tovarishNetworks = [];

12
dist/tornado.umd.js vendored

@ -59709,14 +59709,14 @@ function getTovarishNetworks(registryService, relayers) {
return __async(this, null, function* () { return __async(this, null, function* () {
yield Promise.all( yield Promise.all(
relayers.filter((r) => r.tovarishHost).map((relayer) => __async(this, null, function* () { relayers.filter((r) => r.tovarishHost).map((relayer) => __async(this, null, function* () {
var _a, _b; var _a;
try { try {
relayer.tovarishNetworks = yield (0,_providers__WEBPACK_IMPORTED_MODULE_2__/* .fetchData */ .Fd)(relayer.tovarishHost, __spreadProps(__spreadValues({}, registryService.fetchDataOptions), { relayer.tovarishNetworks = yield (0,_providers__WEBPACK_IMPORTED_MODULE_2__/* .fetchData */ .Fd)(relayer.tovarishHost, __spreadProps(__spreadValues({}, registryService.fetchDataOptions), {
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/json"
}, },
timeout: ((_a = registryService.fetchDataOptions) == null ? void 0 : _a.torPort) ? 1e4 : 3e3, timeout: 6e4,
maxRetry: ((_b = registryService.fetchDataOptions) == null ? void 0 : _b.torPort) ? 2 : 0 maxRetry: ((_a = registryService.fetchDataOptions) == null ? void 0 : _a.torPort) ? 2 : 0
})); }));
} catch (e) { } catch (e) {
relayer.tovarishNetworks = []; relayer.tovarishNetworks = [];
@ -72471,7 +72471,7 @@ class RelayerClient {
url, url,
relayerAddress relayerAddress
}) { }) {
var _a, _b; var _a;
if (!url && hostname) { if (!url && hostname) {
url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`; url = `https://${!hostname.endsWith("/") ? hostname + "/" : hostname}`;
} else if (url && !url.endsWith("/")) { } else if (url && !url.endsWith("/")) {
@ -72483,8 +72483,8 @@ class RelayerClient {
headers: { headers: {
"Content-Type": "application/json, application/x-www-form-urlencoded" "Content-Type": "application/json, application/x-www-form-urlencoded"
}, },
timeout: ((_a = this.fetchDataOptions) == null ? void 0 : _a.torPort) ? 1e4 : 3e3, timeout: 6e4,
maxRetry: ((_b = this.fetchDataOptions) == null ? void 0 : _b.torPort) ? 2 : 0 maxRetry: ((_a = this.fetchDataOptions) == null ? void 0 : _a.torPort) ? 2 : 0
})); }));
const statusValidator = _schemas__WEBPACK_IMPORTED_MODULE_3__/* .ajv */ .SS.compile((0,_schemas__WEBPACK_IMPORTED_MODULE_3__/* .getStatusSchema */ .c_)(this.netId, this.config, this.tovarish)); const statusValidator = _schemas__WEBPACK_IMPORTED_MODULE_3__/* .ajv */ .SS.compile((0,_schemas__WEBPACK_IMPORTED_MODULE_3__/* .getStatusSchema */ .c_)(this.netId, this.config, this.tovarish));
if (!statusValidator(rawStatus)) { if (!statusValidator(rawStatus)) {

File diff suppressed because one or more lines are too long

@ -841,7 +841,7 @@ export async function getTovarishNetworks(registryService: BaseRegistryService,
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
timeout: registryService.fetchDataOptions?.torPort ? 10000 : 3000, timeout: 60000,
maxRetry: registryService.fetchDataOptions?.torPort ? 2 : 0, maxRetry: registryService.fetchDataOptions?.torPort ? 2 : 0,
}); });
} catch { } catch {

@ -223,7 +223,7 @@ export class RelayerClient {
headers: { headers: {
'Content-Type': 'application/json, application/x-www-form-urlencoded', 'Content-Type': 'application/json, application/x-www-form-urlencoded',
}, },
timeout: this.fetchDataOptions?.torPort ? 10000 : 3000, timeout: 60000,
maxRetry: this.fetchDataOptions?.torPort ? 2 : 0, maxRetry: this.fetchDataOptions?.torPort ? 2 : 0,
})) as object; })) as object;