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