Fixing another timeout problem

This commit is contained in:
Selim Mustafaev 2024-10-12 11:30:56 +03:00
parent d42ec39038
commit d394f265c5

View File

@ -1,4 +1,3 @@
import AbortController from 'abort-controller';
import DebugInfo from '../models/DebugInfo.js'; import DebugInfo from '../models/DebugInfo.js';
import Vehicle from '../models/vehicle.js'; import Vehicle from '../models/vehicle.js';
import Utils from '../utils/utils.js'; import Utils from '../utils/utils.js';
@ -20,15 +19,16 @@ class Vin01Provider {
} }
static async runCheck(type, vin, token) { static async runCheck(type, vin, token) {
let result = await fetchWithTimeout(reportBaseUrl, { let result = await fetch(reportBaseUrl, {
method: 'POST', method: 'POST',
body: new URLSearchParams({ body: new URLSearchParams({
typeCheckValue: type, typeCheckValue: type,
vinValue: vin, vinValue: vin,
key: token, key: token,
token: null token: null
}) }),
}, 25000); signal: AbortSignal.timeout(14000)
});
console.log('Vin01 response for: ', type); console.log('Vin01 response for: ', type);
return await result.json(); return await result.json();
} }