Browse Source

Fix bug in timers_uv timeout recomputation

Closes #1209
v0.7.4-release
Bert Belder 14 years ago
parent
commit
1037f5c113
  1. 5
      lib/timers_uv.js

5
lib/timers_uv.js

@ -67,8 +67,7 @@ function insert(item, msecs) {
list.ontimeout = function() {
debug('timeout callback ' + msecs);
// TODO - don't stop and start the watcher all the time.
// just set its repeat
var now = new Date();
debug('now: ' + now);
@ -76,7 +75,7 @@ function insert(item, msecs) {
while (first = L.peek(list)) {
var diff = now - first._idleStart;
if (diff + 1 < msecs) {
list.start(diff, 0);
list.start(msecs - diff, 0);
debug(msecs + ' list wait because diff is ' + diff);
return;
} else {

Loading…
Cancel
Save