Skip to content

Commit 96415c6

Browse files
committed
fix(onwakeup): Increase onwakeup timeout
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 3c55eb1 commit 96415c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/on-wake-up.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const CLOCK = 1000
2+
const TIMEOUT = 2 * 60 * 1000 // 2 mins
23

34
export function onWakeUp(fn: () => void) {
45
let then = Date.now()
@@ -11,7 +12,7 @@ export function onWakeUp(fn: () => void) {
1112

1213
function tick() {
1314
const now = Date.now()
14-
if (now - then > 2 * CLOCK) fn()
15+
if (now - then > TIMEOUT) fn()
1516
then = now
1617
}
1718
}

0 commit comments

Comments
 (0)