Browse Source

some renamings

pull/1/head
Alexey Velikiy 7 years ago
parent
commit
e605d699ba
  1. 4
      analytics/worker.py
  2. 6
      server/src/controllers/analytics_controller.ts
  3. 4
      server/src/services/analytics_service.ts

4
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):

6
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<any> {
};
task.__task_id = nextTaskId++;
await analyticsConnection.sendTask(task);
await analyticsService.sendTask(task);
return new Promise<void>(resolve => {
taskMap[task.__task_id] = resolve;

4
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();

Loading…
Cancel
Save