|
|
@ -581,7 +581,7 @@ export async function getHSR(analyticUnit: AnalyticUnit.AnalyticUnit, from: numb |
|
|
|
|
|
|
|
|
|
|
|
if(analyticUnit.detectorType !== AnalyticUnit.DetectorType.ANOMALY) { |
|
|
|
if(analyticUnit.detectorType !== AnalyticUnit.DetectorType.ANOMALY) { |
|
|
|
return data; |
|
|
|
return data; |
|
|
|
} else { |
|
|
|
} |
|
|
|
let cache = await AnalyticUnitCache.findById(analyticUnit.id); |
|
|
|
let cache = await AnalyticUnitCache.findById(analyticUnit.id); |
|
|
|
if( |
|
|
|
if( |
|
|
|
cache === null || |
|
|
|
cache === null || |
|
|
@ -608,8 +608,7 @@ export async function getHSR(analyticUnit: AnalyticUnit.AnalyticUnit, from: numb |
|
|
|
if(result.status !== AnalyticUnit.AnalyticUnitStatus.SUCCESS) { |
|
|
|
if(result.status !== AnalyticUnit.AnalyticUnitStatus.SUCCESS) { |
|
|
|
throw new Error(`Data processing error: ${result.error}`); |
|
|
|
throw new Error(`Data processing error: ${result.error}`); |
|
|
|
} |
|
|
|
} |
|
|
|
return { values: result.payload.data, columns: data.columns } |
|
|
|
return { values: result.payload.data, columns: data.columns }; |
|
|
|
} |
|
|
|
|
|
|
|
} catch (err) { |
|
|
|
} catch (err) { |
|
|
|
const message = err.message || JSON.stringify(err); |
|
|
|
const message = err.message || JSON.stringify(err); |
|
|
|
await AnalyticUnit.setStatus(analyticUnit.id, AnalyticUnit.AnalyticUnitStatus.FAILED, message); |
|
|
|
await AnalyticUnit.setStatus(analyticUnit.id, AnalyticUnit.AnalyticUnitStatus.FAILED, message); |
|
|
|