From cfdd09d9acd812efc349785ec85854cce4cb00c3 Mon Sep 17 00:00:00 2001 From: Zamitto Date: Wed, 1 May 2024 19:11:05 -0300 Subject: [PATCH] feat: move sleep to end of function on process-watcher --- src/main/services/process-watcher.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/services/process-watcher.ts b/src/main/services/process-watcher.ts index 9cce8a7a..74811735 100644 --- a/src/main/services/process-watcher.ts +++ b/src/main/services/process-watcher.ts @@ -13,15 +13,13 @@ export const startProcessWatcher = async () => { // eslint-disable-next-line no-constant-condition while (true) { - await sleep(sleepTime); - const games = await gameRepository.find({ where: { executablePath: Not(IsNull()), }, }); - if (games.length == 0) { + if (games.length === 0) { continue; } @@ -71,5 +69,7 @@ export const startProcessWatcher = async () => { } } } + + await sleep(sleepTime); } };