From f93d10f8503e06f1de6d628efa063e9a9efe4999 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Sat, 18 Dec 2021 14:29:27 -0600 Subject: [PATCH] run keep awake every 30 seconds --- functions/src/keep-awake.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/functions/src/keep-awake.ts b/functions/src/keep-awake.ts index cdc701e0..85aa3475 100644 --- a/functions/src/keep-awake.ts +++ b/functions/src/keep-awake.ts @@ -9,4 +9,15 @@ export const keepAwake = functions.pubsub callCloudFunction('placeBet'), callCloudFunction('resolveMarket'), ]) + + await sleep(30) + + await Promise.all([ + callCloudFunction('placeBet'), + callCloudFunction('resolveMarket'), + ]) }) + +const sleep = (seconds: number) => { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)) +}