mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +09:00
2 files changed
+8
-5
No files matched your search
@@ -379,17 +379,20 @@ POST Get metadata from a single slave. For whenever you find the data returned b
|
||||
app.post("/api/getSlaveMeta", function (req, res) {
|
||||
endpointHitCounter.labels(req.route.path).inc();
|
||||
console.log("body", req.body);
|
||||
if(req.body && req.body.instanceID){
|
||||
if (slaves[req.body.instanceID]) {
|
||||
if(req.body && req.body.instanceID){
|
||||
if (slaves[req.body.instanceID]) {
|
||||
console.log("returning meta for ", req.body.instanceID);
|
||||
if(!slaves[req.body.instanceID].meta) {
|
||||
slaves[req.body.instanceID].meta = {};
|
||||
}
|
||||
res.send(JSON.stringify(slaves[req.body.instanceID].meta))
|
||||
} else {
|
||||
res.status(404)
|
||||
res.send('{"status": 404, "info": "Slave not registered"}')
|
||||
}
|
||||
} else {
|
||||
res.status(400);
|
||||
res.send('{"INVALID REQUEST":1}');
|
||||
res.status(400);
|
||||
res.send('{"INVALID_REQUEST":1}');
|
||||
}
|
||||
});
|
||||
// mod management
|
||||
|
||||
@@ -128,7 +128,7 @@ class ResearchSync {
|
||||
|
||||
request_cluster_data() {
|
||||
const slaves_data_url = `${this.config.masterIP}:${this.config.masterPort}/api/slaves`
|
||||
needle.get(slaves_data_url, this.sync_researches.bind(this), {compressed:true})
|
||||
needle.get(slaves_data_url, {compressed:true}, this.sync_researches.bind(this))
|
||||
}
|
||||
|
||||
sync_researches(err, resp, slaves_data) {
|
||||
|
||||
Reference in new issue
Block a user