mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +09:00
researchSync: Fixed crash when master contact is lost
This commit is contained in:
1 parent
1d0d9765bd
commit
6bbd6b8717
1 file changed
+5
-3
@@ -11,8 +11,8 @@ class ResearchSync {
|
||||
this.research = {};
|
||||
|
||||
setInterval(() => {
|
||||
this.doSync();
|
||||
this.pollResearch();
|
||||
setTimeout(this.doSync, 2000);
|
||||
}, extras.researchSyncPollInterval || 30000);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,10 @@ class ResearchSync {
|
||||
needle.post(this.config.masterIP + ':' + this.config.masterPort + '/api/getSlavesMeta', {
|
||||
password: this.config.clientPassword,
|
||||
}, (err, resp, body) => {
|
||||
if (err) throw err;
|
||||
|
||||
if (err){
|
||||
this.messageInterface("Unable to post JSON master/api/getSlavesMeta, master might be unaccessible";
|
||||
return false;
|
||||
}
|
||||
if (resp.statusCode != 200){
|
||||
this.messageInterface("got error when calling getSlaveMeta", resp.statusCode, resp.body);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user