diff options
author | David Gay <david@davidgay.org> | 2021-06-07 21:24:02 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-07 21:24:02 -0400 |
commit | 39178217ecf722fbd902e07a053e35fa290488f8 (patch) | |
tree | 818522cf10f801a4ec33f73fed7fb1bd5e214e93 /public | |
parent | b6955ee9aa0058f64f6e3b6314d2b7358939bc2e (diff) |
Hook in new web worker stuff with finish activity POST retry stuff
Diffstat (limited to 'public')
-rw-r--r-- | public/timer_worker.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/public/timer_worker.js b/public/timer_worker.js index 3d3e79a..c62679a 100644 --- a/public/timer_worker.js +++ b/public/timer_worker.js @@ -1,10 +1,11 @@ let timerInterval = null; +let timerTimeout = 10; function setTimerInterval() { if (!timerInterval) { timerInterval = setInterval(function() { postMessage("timerTick"); - }, 10); + }, timerTimeout); } } @@ -20,5 +21,7 @@ onmessage = function(event) { } else { clearTimerInterval(); } + } else if ("set_timeout" in event.data) { + timerTimeout = event.data["set_timeout"]; } } |