|
|
@ -190,6 +190,10 @@ export async function runPredict(id: AnalyticUnit.AnalyticUnitId) { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let lastPredictedSegments = await Segment.findMany(id, { labeled: false, deleted: false }); |
|
|
|
|
|
|
|
let segmentsToRemove = lastPredictedSegments.filter(s => payload.segments.indexOf(s) === -1); |
|
|
|
|
|
|
|
Segment.removeSegments(segmentsToRemove.map(s => s.id)); |
|
|
|
|
|
|
|
|
|
|
|
Segment.insertSegments(payload.segments); |
|
|
|
Segment.insertSegments(payload.segments); |
|
|
|
AnalyticUnitCache.setData(id, payload.cache); |
|
|
|
AnalyticUnitCache.setData(id, payload.cache); |
|
|
|
AnalyticUnit.setPredictionTime(id, payload.lastPredictionTime); |
|
|
|
AnalyticUnit.setPredictionTime(id, payload.lastPredictionTime); |
|
|
|