mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-25 16:33:12 +09:00
Fixed error occasionally crashing client when plugins use lots of IO
This commit is contained in:
1 parent
cd4887e5cf
commit
50d14394a6
1 file changed
+11
-9
@@ -473,15 +473,17 @@ function instanceManagement() {
|
|||||||
|
|
||||||
// send file contents to plugin for processing
|
// send file contents to plugin for processing
|
||||||
function fileChangeHandler(eventType, filename) {
|
function fileChangeHandler(eventType, filename) {
|
||||||
// get array of lines in file
|
if(filename != null){
|
||||||
let stuff = fs.readFileSync(instancedirectory + "/script-output/" + filename, "utf8").split("\n");
|
// get array of lines in file
|
||||||
// if you found anything, reset the file
|
let stuff = fs.readFileSync(instancedirectory + "/script-output/" + filename, "utf8").split("\n");
|
||||||
if (stuff[0]) {
|
// if you found anything, reset the file
|
||||||
fs.writeFileSync(instancedirectory + "/script-output/" + filename, "");
|
if (stuff[0]) {
|
||||||
}
|
fs.writeFileSync(instancedirectory + "/script-output/" + filename, "");
|
||||||
for(let i = 0; i < stuff.length; i++) {
|
}
|
||||||
if(stuff[i]) {
|
for(let i = 0; i < stuff.length; i++) {
|
||||||
plugins[I].scriptOutput(stuff[i]);
|
if(stuff[i]) {
|
||||||
|
plugins[I].scriptOutput(stuff[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user