From 95bc028abebeac13bdfb881813159e4f14ee961b Mon Sep 17 00:00:00 2001 From: arshiam2 <arshiam2@illinois.edu> Date: Sat, 1 Dec 2018 21:54:54 -0600 Subject: [PATCH] update --- cli/src/commands/put-stream.js | 2 +- sfds/index.js | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/cli/src/commands/put-stream.js b/cli/src/commands/put-stream.js index c13e48f..dfa0b23 100644 --- a/cli/src/commands/put-stream.js +++ b/cli/src/commands/put-stream.js @@ -75,7 +75,7 @@ module.exports.handler = handleErrors(async (argv: {}) => { // if (json.action !== "END") { // queue.push(json); // } else { - console.log(json); + // console.log(json); // } }); } diff --git a/sfds/index.js b/sfds/index.js index 22a1df2..fcf4c41 100644 --- a/sfds/index.js +++ b/sfds/index.js @@ -400,29 +400,22 @@ results = []; app.post("/bolt", function(req, res) { console.log("bolt state: " +req.body.state) - - // console.log(req.body); - // console.log(resolver(req.body)); - // queue.push(req.body) - // console.log(queue.length) res.send(resolver(req.body)); }); app.post("/spout", function(req, res) { queue.push(req.body) - // console.log(queue.length) res.send("got it"); }); + round_robin = 0 setInterval(function sync() { if (queue.length > 0) { const body = queue.pop(); - // print(clients.length) - // console.log("SENDING TO" + round_robin + " " + clients.length) - let url = "http://" + machineToIps[ clients[round_robin % clients.length] ] + ":3000/bolt/"; + let url = "http://" + machineToIps[clients[round_robin % clients.length] ] + ":3000/bolt/"; round_robin += 1; fetch(url, { method: "post", -- GitLab