Skip to content
Snippets Groups Projects
Commit 20308d7b authored by arshiam2's avatar arshiam2
Browse files

update:

parent 50e9a1fb
No related branches found
No related tags found
No related merge requests found
Pipeline #80714 canceled
...@@ -62,17 +62,20 @@ module.exports.handler = handleErrors(async (argv: {}) => { ...@@ -62,17 +62,20 @@ module.exports.handler = handleErrors(async (argv: {}) => {
setInterval(function sync() { setInterval(function sync() {
if (queue.length > 0) { if (queue.length > 0) {
const body = queue.pop(); const body = queue.pop();
fetch("http://localhost:3000/spout", { var target = "http://"+ master + ":3000/spout/";
console.log(target)
console.log(JSON.stringify(body))
fetch(target, {
method: "post", method: "post",
body: JSON.stringify(body), body: JSON.stringify(body),
headers: { "Content-Type": "application/json" } headers: { "Content-Type": "application/json" }
}) })
.then(res => res.json()) .then(res => res.text())
.then(json => { .then(json => {
// if (json.action !== "END") { // if (json.action !== "END") {
// queue.push(json); // queue.push(json);
// } else { // } else {
console.log(json.state); console.log(json);
// } // }
}); });
} }
......
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