mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +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() {
|
async onLoadFinish() {
|
||||||
this.items = await loadDatabase(this.config);
|
this.items = await loadDatabase(this.config);
|
||||||
this.autosaveId = setInterval(async function() {
|
this.autosaveId = setInterval(async () => {
|
||||||
let file = path.join(this.config.databaseDirectory, "items.json");
|
await saveDatabase(this.config, this.items);
|
||||||
console.log(`autosaving ${file}`);
|
|
||||||
let content = JSON.stringify(db.items.serialize());
|
|
||||||
await fs.outputFile(file, content);
|
|
||||||
},this.config.autosaveInterval || 60000);
|
},this.config.autosaveInterval || 60000);
|
||||||
|
|
||||||
routes.addApiRoutes(
|
routes.addApiRoutes(
|
||||||
|
|||||||
Reference in new issue
Block a user