Fixed error occasionally crashing client when plugins use lots of IO

This commit is contained in:
Danielv123 committed 2018-04-02 14:59:58 +02:00
1 parent cd4887e5cf
commit 50d14394a6
1 file changed
+2
+2
View File
@@ -473,6 +473,7 @@ function instanceManagement() {
// send file contents to plugin for processing // send file contents to plugin for processing
function fileChangeHandler(eventType, filename) { function fileChangeHandler(eventType, filename) {
if(filename != null){
// get array of lines in file // get array of lines in file
let stuff = fs.readFileSync(instancedirectory + "/script-output/" + filename, "utf8").split("\n"); let stuff = fs.readFileSync(instancedirectory + "/script-output/" + filename, "utf8").split("\n");
// if you found anything, reset the file // if you found anything, reset the file
@@ -486,6 +487,7 @@ function instanceManagement() {
} }
} }
} }
}
console.log("Clusterio | Loaded plugin " + pluginDirectories[i]); console.log("Clusterio | Loaded plugin " + pluginDirectories[i]);
} else if(pluginConfig.binary != "nodePackage"){ } else if(pluginConfig.binary != "nodePackage"){
// handle as fragile executable plugin // handle as fragile executable plugin