Skip to content
Snippets Groups Projects
Commit 0c2eb052 authored by arshiam2's avatar arshiam2
Browse files

update

parent 2708f0fa
No related branches found
No related tags found
No related merge requests found
// @flow
const path = require("path");
const chalk = require("chalk");
const fs = require("fs");
const util = require("util");
const net = require("net");
const process = require("process");
var request = require("request");
const handleErrors = require("../utils/handleErrors");
const getMaster = require("../utils/getMaster");
module.exports.command = "get-second";
module.exports.describe = "Writes the names of the latest numversions of sdfsfilename to a localfilename.";
module.exports.builder = (yargs: any) => yargs;
module.exports.handler = handleErrors(async (argv: {}) => {
const master = await getMaster()
var target = "http://"+ master + ":3000/getSecond/";
request.post(target, function(error, response, body) {
console.log(body.toString())
// fs.writeFile(argv.localfilename, body.toString(), function(err) {
// if (err) console.log(err)
// console.log("Written to " + process.cwd() + "/" + argv.localfilename)
// process.exit(0)
// });
// process.exit(0)
})
});
......@@ -416,6 +416,12 @@ app.get("/sink", function(req, res) {
}
});
app.post("/getSecond", function(req, res) {
// console.log("spout got: " + req.body.state);
// queue.push(req.body);
res.send("second");
});
round_robin = 0;
setInterval(function sync() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment