Added support for docker volumes

This commit is contained in:
MrFreasy 2023-06-03 11:56:42 +02:00 committed by MrFreasy
parent 8f565c7424
commit b8ff2e0cd8
4 changed files with 6 additions and 6 deletions

3
.gitignore vendored

@ -5,8 +5,7 @@ node_modules/
minetrack.log minetrack.log
# minetrack/sqlite3 # minetrack/sqlite3
database.sql data/
database.sql-journal
# macOS # macOS
.DS_Store .DS_Store

@ -4,7 +4,7 @@
"ip": "0.0.0.0" "ip": "0.0.0.0"
}, },
"rates": { "rates": {
"pingAll": 3000, "pingAll": 15000,
"connectTimeout": 2500 "connectTimeout": 2500
}, },
"oldPingsCleanup": { "oldPingsCleanup": {
@ -12,7 +12,7 @@
"interval": 3600000 "interval": 3600000
}, },
"logFailedPings": true, "logFailedPings": true,
"logToDatabase": false, "logToDatabase": true,
"graphDuration": 86400000, "graphDuration": 86400000,
"serverGraphDuration": 180000 "serverGraphDuration": 180000
} }

0
data/.gitkeep Normal file

@ -4,11 +4,12 @@ const logger = require('./logger')
const config = require('../config') const config = require('../config')
const { TimeTracker } = require('./time') const { TimeTracker } = require('./time')
const dataFolder = 'data/';
class Database { class Database {
constructor (app) { constructor (app) {
this._app = app this._app = app
this._sql = new sqlite.Database('database.sql') this._sql = new sqlite.Database(dataFolder + 'database.sql')
} }
getDailyDatabase () { getDailyDatabase () {
@ -24,7 +25,7 @@ class Database {
this._currentDatabaseCopyInstance.close() this._currentDatabaseCopyInstance.close()
} }
this._currentDatabaseCopyInstance = new sqlite.Database(fileName) this._currentDatabaseCopyInstance = new sqlite.Database(dataFolder + fileName)
this._currentDatabaseCopyFileName = fileName this._currentDatabaseCopyFileName = fileName
// Ensure the initial tables are created // Ensure the initial tables are created