mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
Plugin loading race condition, resolves #136
This commit is contained in:
1 parent
810e4a27b5
commit
852311e84c
1 file changed
+6
-7
@@ -29,13 +29,12 @@ module.exports = function(config){
|
||||
}
|
||||
|
||||
// check if plugin is enabled
|
||||
fs.stat(path.join(pluginConfig.pluginPath, "DISABLED"), (err, stat)=>{
|
||||
if(err){
|
||||
pluginConfig.enabled = true;
|
||||
} else {
|
||||
pluginConfig.enabled = false;
|
||||
}
|
||||
});
|
||||
try{
|
||||
await fs.stat(path.join(pluginConfig.pluginPath, "DISABLED"))
|
||||
pluginConfig.enabled = false;
|
||||
}catch(e){
|
||||
pluginConfig.enabled = true;
|
||||
}
|
||||
returnArray.push(pluginConfig);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user