From 1ddb3ef339c957ab505dd8cca37d04f74437a1bc Mon Sep 17 00:00:00 2001 From: Mary Date: Mon, 1 Apr 2024 10:08:28 +0700 Subject: [PATCH] fix: only wait if delta gt 0 --- app/desktop/lib/moderation/update.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/desktop/lib/moderation/update.ts b/app/desktop/lib/moderation/update.ts index 34a95408..9d375e29 100644 --- a/app/desktop/lib/moderation/update.ts +++ b/app/desktop/lib/moderation/update.ts @@ -16,7 +16,9 @@ const requestLock = async () => { const delta = nextUpdatedAt - Date.now(); - await new Promise((resolve) => setTimeout(resolve, delta)); + if (delta > 0) { + await new Promise((resolve) => setTimeout(resolve, delta)); + } let views: AppBskyLabelerDefs.LabelerViewDetailed[] | undefined; try {