Commit b5471d2d authored by nilanjandaw's avatar nilanjandaw

minor bug fixes

parent fb183429
......@@ -153,7 +153,7 @@ function dispatch() {
}
function getAddress() {
return items[Math.floor(Math.random() * items.length)];
return workerNodes[Math.floor(Math.random() * workerNodes.length)];
}
......@@ -170,8 +170,8 @@ client.on('message', function (topic, message) {
db.delete(message.function_id)
} else if (topic === "heartbeat") {
message = JSON.parse(message)
if (workerNodes.indexOf(newItem) === -1)
workerNodes.push(newItem)
if (workerNodes.indexOf(message.address) === -1)
workerNodes.push(message.address)
console.log(workerNodes);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment