Browse Source

Fix paths

pull/1/head
rozetko 7 years ago
parent
commit
4ec5af5977
  1. 5
      analytics/config.py
  2. 1
      server/src/config.ts
  3. 5
      server/src/services/data.ts

5
analytics/config.py

@ -1,8 +1,7 @@
import os
DATA_FOLDER = '../../data'
DATASOURCE_FOLDER = os.path.join(DATA_FOLDER, "datasources/")
DATA_FOLDER = '../data'
DATASET_FOLDER = os.path.join(DATA_FOLDER, "datasets/")
ANOMALIES_FOLDER = os.path.join(DATA_FOLDER, "anomalies/")
MODELS_FOLDER = os.path.join(DATA_FOLDER, "models/")
METRICS_FOLDER = os.path.join(DATA_FOLDER, "metrics/")
METRICS_FOLDER = os.path.join(DATA_FOLDER, "metrics/")

1
server/src/config.ts

@ -4,7 +4,6 @@ export const ANALYTICS_PATH = path.join(__dirname, '../../analytics');
export const DATA_PATH = path.join(__dirname, '../../data');
export const DATASOURCES_PATH = path.join(DATA_PATH, 'datasources');
export const DATASETS_PATH = path.join(DATA_PATH, 'datasets');
export const ANOMALIES_PATH = path.join(DATA_PATH, 'anomalies');
export const MODELS_PATH = path.join(DATA_PATH, 'models');

5
server/src/services/data.ts

@ -5,7 +5,7 @@ import * as fs from 'fs';
// see analytics/pattern_detection_model.py with folders available
function maybeCreate(path: string): void {
if(fs.existsSync(config.DATA_PATH)) {
if(fs.existsSync(path)) {
return;
}
fs.mkdirSync(path);
@ -14,11 +14,10 @@ function maybeCreate(path: string): void {
export function checkDataFolders(): void {
var folders = [
config.DATA_PATH,
config.DATASOURCES_PATH,
config.DATASETS_PATH,
config.ANOMALIES_PATH,
config.MODELS_PATH,
config.METRICS_PATH,
config.SEGMENTS_PATH
].forEach(maybeCreate);
}
}

Loading…
Cancel
Save