Skip to content

Commit 7a0432a

Browse files
author
Carlos Rodriguez
committed
Fix zmq publisher test.
1 parent 7bdc3d1 commit 7a0432a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

zmq-pub.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ var socket = zmq.socket('pub');
1515
socket.identity = 'publisher' + process.pid;
1616

1717
socket.bind(address, function(err) {
18-
var doit = function() {
19-
var time = new Date().getTime();
20-
socket.send('TIME ' + time);
21-
stats.updateCounts();
22-
process.nextTick(doit);
18+
if (err) {
19+
console.error(err);
20+
process.exit(1);
2321
}
24-
doit();
2522
});
23+
24+
var doit = function() {
25+
var time = new Date().getTime();
26+
socket.send('TIME ' + time);
27+
stats.updateCounts();
28+
process.nextTick(doit);
29+
}
30+
31+
setTimeout(doit, 1000);

0 commit comments

Comments
 (0)