mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 16:13:12 +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 = {};
|
this.research = {};
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
this.doSync();
|
|
||||||
this.pollResearch();
|
this.pollResearch();
|
||||||
|
setTimeout(this.doSync, 2000);
|
||||||
}, extras.researchSyncPollInterval || 30000);
|
}, extras.researchSyncPollInterval || 30000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,8 +25,10 @@ class ResearchSync {
|
|||||||
needle.post(this.config.masterIP + ':' + this.config.masterPort + '/api/getSlavesMeta', {
|
needle.post(this.config.masterIP + ':' + this.config.masterPort + '/api/getSlavesMeta', {
|
||||||
password: this.config.clientPassword,
|
password: this.config.clientPassword,
|
||||||
}, (err, resp, body) => {
|
}, (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){
|
if (resp.statusCode != 200){
|
||||||
this.messageInterface("got error when calling getSlaveMeta", resp.statusCode, resp.body);
|
this.messageInterface("got error when calling getSlaveMeta", resp.statusCode, resp.body);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user