Reschedule all timers on time travel, set interval back to 1000ms
FREEBIE
This commit is contained in:
parent
bc437095f6
commit
9c8fe1a9d8
2 changed files with 10 additions and 10 deletions
|
@ -39,17 +39,17 @@
|
|||
var time = storage.get('nextSignedKeyRotationTime', now);
|
||||
|
||||
if (scheduledTime !== time || !timeout) {
|
||||
scheduledTime = time;
|
||||
|
||||
console.log('Next signed key rotation scheduled for', new Date(time));
|
||||
var waitTime = time - now;
|
||||
if (waitTime < 0) {
|
||||
waitTime = 0;
|
||||
}
|
||||
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(runWhenOnline, waitTime);
|
||||
}
|
||||
|
||||
scheduledTime = time;
|
||||
var waitTime = time - now;
|
||||
if (waitTime < 0) {
|
||||
waitTime = 0;
|
||||
}
|
||||
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(runWhenOnline, waitTime);
|
||||
}
|
||||
|
||||
Whisper.RotateSignedPreKeyListener = {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
window.Whisper = window.Whisper || {};
|
||||
|
||||
var lastTime;
|
||||
var interval = 5000;
|
||||
var interval = 1000;
|
||||
var events;
|
||||
function checkTime() {
|
||||
var currentTime = Date.now();
|
||||
|
|
Loading…
Reference in a new issue