mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-10 19:52:53 +00:00
feat: move EXTERNAL_REQUEST_TIMEOUT to config file
This commit is contained in:
committed by
Rainer Killinger
parent
8eab6b8531
commit
5d6d4b53f0
@@ -50,6 +50,7 @@ const config: Partial<SCConfigFile> = {
|
||||
},
|
||||
backend: {
|
||||
SCVersion: '1.0.0',
|
||||
externalRequestTimeout: 5000,
|
||||
hiddenTypes: [
|
||||
SCThingType.DateSeries,
|
||||
SCThingType.Diff,
|
||||
|
||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -219,13 +219,13 @@
|
||||
}
|
||||
},
|
||||
"@openstapps/core": {
|
||||
"version": "0.25.0",
|
||||
"resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.25.0.tgz",
|
||||
"integrity": "sha512-Xh+ub2Drns+fORaYt0K/RQ6N1MpYP3llpxEq3SBh48qPCwVBYJ4OVYaJEtSxN/Soxyk2l/7DioTBNvnYiya4MQ==",
|
||||
"version": "0.26.0",
|
||||
"resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.26.0.tgz",
|
||||
"integrity": "sha512-r8mAplHPY7gS8EsuQv8NHfqR4TZ2ptEouMPjtvx2L7I0g0+YgnYO9ZP0QQGHmEeLYoJ01XdDkxOAasXsa2KGBw==",
|
||||
"requires": {
|
||||
"@types/geojson": "1.0.6",
|
||||
"@types/json-patch": "0.0.30",
|
||||
"@types/node": "10.14.13",
|
||||
"@types/node": "10.14.14",
|
||||
"fast-clone": "1.5.13",
|
||||
"http-status-codes": "1.3.2",
|
||||
"json-patch": "0.7.0",
|
||||
@@ -234,9 +234,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "10.14.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.13.tgz",
|
||||
"integrity": "sha512-yN/FNNW1UYsRR1wwAoyOwqvDuLDtVXnaJTZ898XIw/Q5cCaeVAlVwvsmXLX5PuiScBYwZsZU4JYSHB3TvfdwvQ=="
|
||||
"version": "10.14.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.14.tgz",
|
||||
"integrity": "sha512-xXD08vZsvpv4xptQXj1+ky22f7ZoKu5ZNI/4l+/BXG3X+XaeZsmaFbbTKuhSE3NjjvRuZFxFf9sQBMXIcZNFMQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@openstapps/core": "0.25.0",
|
||||
"@openstapps/core": "0.26.0",
|
||||
"@openstapps/core-tools": "0.8.0",
|
||||
"@openstapps/logger": "0.4.0",
|
||||
"@types/node": "10.14.12",
|
||||
|
||||
@@ -21,12 +21,7 @@ import {
|
||||
} from '@openstapps/core';
|
||||
import {Request} from 'express';
|
||||
import * as got from 'got';
|
||||
import {isTestEnvironment, validator} from '../common';
|
||||
|
||||
/**
|
||||
* Number of milliseconds after which external request will fail
|
||||
*/
|
||||
export const EXTERNAL_REQUEST_TIMEOUT = 5000;
|
||||
import {configFile, isTestEnvironment, validator} from '../common';
|
||||
|
||||
/**
|
||||
* Generic route function used to proxy actual requests to plugins
|
||||
@@ -49,7 +44,7 @@ export async function virtualPluginRoute(req: Request, plugin: SCPluginMetaData)
|
||||
baseUrl: plugin.address,
|
||||
body: req.body,
|
||||
json: true,
|
||||
timeout: EXTERNAL_REQUEST_TIMEOUT,
|
||||
timeout: configFile.backend.externalRequestTimeout,
|
||||
},
|
||||
);
|
||||
responseBody = pluginResponse.body;
|
||||
|
||||
Reference in New Issue
Block a user