|
|
@ -199,6 +199,7 @@ export async function runLearning(id: AnalyticUnit.AnalyticUnitId) { |
|
|
|
await AnalyticUnitCache.create(id); |
|
|
|
await AnalyticUnitCache.create(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: create an analytics serialization method in AnalyticUnit
|
|
|
|
let analyticUnitType = analyticUnit.type; |
|
|
|
let analyticUnitType = analyticUnit.type; |
|
|
|
let detector = AnalyticUnit.getDetectorByType(analyticUnitType); |
|
|
|
let detector = AnalyticUnit.getDetectorByType(analyticUnitType); |
|
|
|
let taskPayload: any = { detector, analyticUnitType, cache: oldCache }; |
|
|
|
let taskPayload: any = { detector, analyticUnitType, cache: oldCache }; |
|
|
@ -389,8 +390,8 @@ export async function createAnalyticUnitFromObject(obj: any): Promise<AnalyticUn |
|
|
|
if(obj.datasource !== undefined) { |
|
|
|
if(obj.datasource !== undefined) { |
|
|
|
obj.metric.datasource = obj.datasource; |
|
|
|
obj.metric.datasource = obj.datasource; |
|
|
|
} |
|
|
|
} |
|
|
|
let unit: AnalyticUnit.AnalyticUnit = AnalyticUnit.AnalyticUnit.fromObject(obj); |
|
|
|
const unit: AnalyticUnit.AnalyticUnit = AnalyticUnit.AnalyticUnit.fromObject(obj); |
|
|
|
let id = await AnalyticUnit.create(unit); |
|
|
|
const id = await AnalyticUnit.create(unit); |
|
|
|
|
|
|
|
|
|
|
|
return id; |
|
|
|
return id; |
|
|
|
} |
|
|
|
} |
|
|
|