Fix clusterioMod item autosaving

Fix the autosave code being broken by the move in e4aae88.
This commit is contained in:
Hornwitser committed 2019-11-20 22:37:25 +01:00
1 parent d38e9a53c4
commit ca2967e255
1 file changed
+2 -5
+2 -5
View File
@@ -51,11 +51,8 @@ class masterPlugin {
async onLoadFinish() {
this.items = await loadDatabase(this.config);
this.autosaveId = setInterval(async function() {
let file = path.join(this.config.databaseDirectory, "items.json");
console.log(`autosaving ${file}`);
let content = JSON.stringify(db.items.serialize());
await fs.outputFile(file, content);
this.autosaveId = setInterval(async () => {
await saveDatabase(this.config, this.items);
},this.config.autosaveInterval || 60000);
routes.addApiRoutes(