|
|
@@ -43,7 +43,7 @@ |
|
|
|
function init() { |
|
|
|
console.log("init..."); |
|
|
|
post("/webevents/register", function(err, res) { |
|
|
|
console.log("Init done", err ? "with errors" : "no errors"); |
|
|
|
console.log("Init done,", err ? "with errors" : "no errors"); |
|
|
|
|
|
|
|
// Retry on error |
|
|
|
if (err) { |
|
|
@@ -52,7 +52,7 @@ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
self.emit("connection"); |
|
|
|
emit("connection"); |
|
|
|
key = res.key; |
|
|
|
await(); |
|
|
|
}); |
|
|
@@ -61,7 +61,7 @@ |
|
|
|
function await() { |
|
|
|
console.log("await..."); |
|
|
|
post("/webevents/await/"+key, function(err, res) { |
|
|
|
console.log("Await done", err ? "with errors" : "no errors"); |
|
|
|
console.log("Await done,", err ? "with errors" : "no errors"); |
|
|
|
|
|
|
|
// Retry on error |
|
|
|
if (err === "ENOTREGISTERED") { |