Fix state.json not pretty printed (#4943)

* state.json format

Since 9774031 the state.json file is not formatted anymore, it's just 1 line.

* Update state.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
Nonsense112
2020-11-11 19:36:15 +02:00
committed by GitHub
parent 7305960d53
commit 1ff4be4600
+1 -2
View File
@@ -3,7 +3,6 @@ const data = require('./util/data');
const settings = require('./util/settings');
const fs = require('fs');
const objectAssignDeep = require('object-assign-deep');
const stringify = require('json-stable-stringify-without-jsonify');
const saveInterval = 1000 * 60 * 5; // 5 minutes
@@ -57,7 +56,7 @@ class State {
save() {
if (settings.get().advanced.cache_state_persistent) {
logger.debug(`Saving state to file ${this.file}`);
const json = stringify(this.state, null, 4);
const json = JSON.stringify(this.state, null, 4);
try {
fs.writeFileSync(this.file, json, 'utf8');
} catch (e) {