Browse Source

No detections after fresh learning #298

pull/1/head
Coin de Gamma 6 years ago
parent
commit
e32b1ad2e0
  1. 10
      server/src/controllers/analytics_controller.ts

10
server/src/controllers/analytics_controller.ts

@ -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);

Loading…
Cancel
Save