fastcheck_api fix
This commit is contained in:
parent
20f37f37d3
commit
60732dc8cf
|
|
@ -228,6 +228,8 @@ export class SheriffService {
|
|||
|
||||
if (loadRutData == null) {
|
||||
console.error('loadRutData failed is null');
|
||||
await logEntry.save();
|
||||
return logEntry.toObject();
|
||||
}
|
||||
//must wait at least 30 seconds before starting the next
|
||||
await new Promise(resolve => setTimeout(resolve, parseInt(process.env.SHERIFF_API_DELAY || '30000')));
|
||||
|
|
@ -235,6 +237,12 @@ export class SheriffService {
|
|||
const summaryData = await makeApiCall('summaryData', 'get', `/helper/${sanitizedRut}/summary?complete=true`); //added complete true
|
||||
console.log(`[DEBUG] After summaryData call, sanitizedRut is still: ${sanitizedRut}`);
|
||||
|
||||
if (summaryData == null) {
|
||||
console.error('summaryData failed is null');
|
||||
await logEntry.save();
|
||||
return logEntry.toObject();
|
||||
}
|
||||
|
||||
let societaryMeshExternal: any[] | null = null;
|
||||
|
||||
if (summaryData.data.societaryMeshExternal && summaryData.data.societaryMeshExternal.length > 0) {
|
||||
|
|
|
|||
|
|
@ -227,6 +227,8 @@ export class sheriffV2Service {
|
|||
//console.log(`[DEBUG] loadRutData response RUT: ${loadRutData?.data?.rut || 'No RUT in response'}`);
|
||||
if (summaryData == null) {
|
||||
console.error('loadRutData failed is null');
|
||||
await logEntry.save();
|
||||
return logEntry.toObject();
|
||||
}
|
||||
if(!summaryData.data) {
|
||||
summaryData.data = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user