mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Fix clusterioMod item autosaving
Fix the autosave code being broken by the move in e4aae88.
This commit is contained in:
1 parent
d38e9a53c4
commit
ca2967e255
1 file changed
+2
-5
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user