commit
26ba0f4a8f
2 changed files with 3 additions and 2 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
#DATABASE_FILE=db.sqlite
|
#DATABASE_FILE=db.sqlite
|
||||||
#METRICS_DATABASE_FILE=metrics.sqlite
|
#METRICS_DATABASE_FILE=metrics.sqlite
|
||||||
#LOGS_DIR=logs
|
#LOGS_DIR=logs
|
||||||
|
#DATA_DIR=
|
||||||
|
|
||||||
#LOCALHOST
|
#LOCALHOST
|
||||||
#ADMIN_TOKEN=
|
#ADMIN_TOKEN=
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ export default class {
|
||||||
lastPersistedCache: number = 0
|
lastPersistedCache: number = 0
|
||||||
constructor(settings: StorageSettings) {
|
constructor(settings: StorageSettings) {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.metricsPath = [settings.dataDir, "metric_events"].join("/")
|
this.metricsPath = [settings.dataDir, "metric_events"].filter(s => !!s).join("/")
|
||||||
this.cachePath = [settings.dataDir, "metric_cache"].join("/")
|
this.cachePath = [settings.dataDir, "metric_cache"].filter(s => !!s).join("/")
|
||||||
if (!fs.existsSync(this.cachePath)) {
|
if (!fs.existsSync(this.cachePath)) {
|
||||||
fs.mkdirSync(this.cachePath, { recursive: true });
|
fs.mkdirSync(this.cachePath, { recursive: true });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue