Skip to content

Commit

Permalink
Fix bug that caused only 1 browser to disconnect.
Browse files Browse the repository at this point in the history
Now all browsers disconnect. The kill_ct counter wasn't initialized
before incrementing.
  • Loading branch information
reid committed Nov 5, 2010
1 parent 5660aeb commit b93b6e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion inc/run.js
Expand Up @@ -78,7 +78,11 @@ YETI = (function yeti (window, document, evaluator) {
var bpm = Math.round( var bpm = Math.round(
( (heartbeats * 60000) / ( (new Date).getTime() - startTime ) ) ( (heartbeats * 60000) / ( (new Date).getTime() - startTime ) )
); );
if (!isNaN(bpm) && bpm > 0) setContent("pulse", bpm); if (!isNaN(bpm) && bpm > 0) {
// add a leading zero if needed, always 2 digits
if ((""+bpm).length < 2) bpm = "0" + bpm;
setContent("pulse", bpm);
}
setContent("timer", reaperSecondsRemaining); setContent("timer", reaperSecondsRemaining);
setContent("heartbeats", heartbeats); setContent("heartbeats", heartbeats);
reaperSecondsRemaining--; reaperSecondsRemaining--;
Expand Down
2 changes: 1 addition & 1 deletion lib/signal.js
Expand Up @@ -3,7 +3,7 @@ var server = require("./server");


var singleton = true; var singleton = true;
var dying = false; var dying = false;
var ct, kill_ct; var ct, kill_ct = 0;


function KILLCB () { function KILLCB () {
kill_ct++ kill_ct++
Expand Down

0 comments on commit b93b6e7

Please sign in to comment.