|
|
@ -212,10 +212,12 @@ export async function runDetect(id: AnalyticUnit.AnalyticUnitId) { |
|
|
|
|
|
|
|
|
|
|
|
await deleteNonDetectedSegments(id, payload); |
|
|
|
await deleteNonDetectedSegments(id, payload); |
|
|
|
|
|
|
|
|
|
|
|
Segment.insertSegments(payload.segments); |
|
|
|
await Promise.all([ |
|
|
|
AnalyticUnitCache.setData(id, payload.cache); |
|
|
|
Segment.insertSegments(payload.segments), |
|
|
|
AnalyticUnit.setDetectionTime(id, payload.lastDetectionTime); |
|
|
|
AnalyticUnitCache.setData(id, payload.cache), |
|
|
|
AnalyticUnit.setStatus(id, AnalyticUnit.AnalyticUnitStatus.READY); |
|
|
|
AnalyticUnit.setDetectionTime(id, payload.lastDetectionTime),
|
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
await AnalyticUnit.setStatus(id, AnalyticUnit.AnalyticUnitStatus.READY); |
|
|
|
} catch(err) { |
|
|
|
} catch(err) { |
|
|
|
let message = err.message || JSON.stringify(err); |
|
|
|
let message = err.message || JSON.stringify(err); |
|
|
|
await AnalyticUnit.setStatus(id, AnalyticUnit.AnalyticUnitStatus.FAILED, message); |
|
|
|
await AnalyticUnit.setStatus(id, AnalyticUnit.AnalyticUnitStatus.FAILED, message); |
|
|
|