From e605d699bac88a1fbab0abb5337f36281176451b Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Sun, 8 Jul 2018 17:42:51 +0300 Subject: [PATCH] some renamings --- analytics/worker.py | 4 ++-- server/src/controllers/analytics_controller.ts | 6 +++--- server/src/services/analytics_service.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/analytics/worker.py b/analytics/worker.py index b3294b9..5df63ad 100644 --- a/analytics/worker.py +++ b/analytics/worker.py @@ -92,9 +92,9 @@ class Worker(object): return { 'task': "predict", 'status': "success", - 'predictor_id': predictor_id, + 'analyticUnitId': predictor_id, 'segments': segments, - 'last_prediction_time': last_prediction_time + 'lastPredictionTime': last_prediction_time } def get_model(self, predictor_id, pattern): diff --git a/server/src/controllers/analytics_controller.ts b/server/src/controllers/analytics_controller.ts index 4e6bcaf..2a7141e 100644 --- a/server/src/controllers/analytics_controller.ts +++ b/server/src/controllers/analytics_controller.ts @@ -1,13 +1,13 @@ import { getTarget } from './metrics_controler'; import { getLabeledSegments, insertSegments, removeSegments } from './segments_controller' import * as AnalyticUnit from '../models/analytic_unit' -import { AnalyticsConnection } from '../services/analytics_service' +import { AnalyticsService } from '../services/analytics_service' const taskMap = {}; let nextTaskId = 0; -const analyticsConnection = new AnalyticsConnection(onResponse); +const analyticsService = new AnalyticsService(onResponse); function onResponse(response: any) { let taskId = response.__task_id; @@ -29,7 +29,7 @@ async function runTask(task): Promise { }; task.__task_id = nextTaskId++; - await analyticsConnection.sendTask(task); + await analyticsService.sendTask(task); return new Promise(resolve => { taskMap[task.__task_id] = resolve; diff --git a/server/src/services/analytics_service.ts b/server/src/services/analytics_service.ts index 15fc120..9b2bab4 100644 --- a/server/src/services/analytics_service.ts +++ b/server/src/services/analytics_service.ts @@ -7,10 +7,10 @@ import * as fs from 'fs'; import * as path from 'path'; - -export class AnalyticsConnection { +export class AnalyticsService { private _requester: any; + constructor(private _onResponse: (response: any) => void) { this._initConnection();