diff --git a/.gitignore b/.gitignore index f8277cc..393a418 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,7 @@ node_modules/ minetrack.log # minetrack/sqlite3 -database.sql -database.sql-journal +data/ # macOS .DS_Store diff --git a/config.json b/config.json index d8d84f9..9d5de32 100644 --- a/config.json +++ b/config.json @@ -4,7 +4,7 @@ "ip": "0.0.0.0" }, "rates": { - "pingAll": 3000, + "pingAll": 15000, "connectTimeout": 2500 }, "oldPingsCleanup": { @@ -12,7 +12,7 @@ "interval": 3600000 }, "logFailedPings": true, - "logToDatabase": false, + "logToDatabase": true, "graphDuration": 86400000, "serverGraphDuration": 180000 } diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lib/database.js b/lib/database.js index c0d5caa..c36a485 100644 --- a/lib/database.js +++ b/lib/database.js @@ -4,11 +4,12 @@ const logger = require('./logger') const config = require('../config') const { TimeTracker } = require('./time') +const dataFolder = 'data/'; class Database { constructor (app) { this._app = app - this._sql = new sqlite.Database('database.sql') + this._sql = new sqlite.Database(dataFolder + 'database.sql') } getDailyDatabase () { @@ -24,7 +25,7 @@ class Database { this._currentDatabaseCopyInstance.close() } - this._currentDatabaseCopyInstance = new sqlite.Database(fileName) + this._currentDatabaseCopyInstance = new sqlite.Database(dataFolder + fileName) this._currentDatabaseCopyFileName = fileName // Ensure the initial tables are created