refactor: update all

This commit is contained in:
openstappsbot
2021-04-20 07:11:37 +00:00
committed by Rainer Killinger
parent df69bfd95f
commit 7424ad9831
5 changed files with 463 additions and 756 deletions

View File

@@ -41,13 +41,12 @@ export async function virtualPluginRoute(req: Request, plugin: SCPluginMetaData)
const pluginResponse = await got.post(
plugin.route,
{
baseUrl: plugin.address,
body: req.body,
json: true,
prefixUrl: plugin.address,
json: req.body,
timeout: configFile.backend.externalRequestTimeout,
},
);
responseBody = pluginResponse.body;
responseBody = JSON.parse(pluginResponse.body);
const responseValidation = validator.validate(responseBody, plugin.responseSchema);
if (responseValidation.errors.length > 0) {
throw new SCValidationErrorResponse(responseValidation.errors, isTestEnvironment);

View File

@@ -132,7 +132,7 @@ export class BulkStorage {
Logger.info('Bulk expires in ', expirationInSeconds, 'seconds');
// save the item in the cache with it's expected expiration
await promisify<string, Bulk, number>(this.cache.set)(bulk.uid, bulk, expirationInSeconds);
await promisify<string, Bulk, number, boolean>(this.cache.set)(bulk.uid, bulk, expirationInSeconds);
return bulk;
}