From 886d34167dcb0d70fdd22304bf4e9b5489421641 Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Thu, 21 Nov 2024 04:34:10 +0100 Subject: [PATCH] stagger more --- next-canary/src/app/actions.ts | 4 ++-- tanstack-start/app/components/ThemeButton.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/next-canary/src/app/actions.ts b/next-canary/src/app/actions.ts index 8f8b2c9..032b58f 100644 --- a/next-canary/src/app/actions.ts +++ b/next-canary/src/app/actions.ts @@ -12,8 +12,8 @@ export async function randomColorTheme(tags: SyncTag[]) { const res = await fetch('https://lcapi-examples-api.sanity.dev/api/random-color-theme', { method: 'PUT', }) - // Wait 1 second to stagger requests a little bit - await new Promise((resolve) => setTimeout(resolve, 1_000)) + // Wait 5 seconds to stagger requests a little bit + await new Promise((resolve) => setTimeout(resolve, 5_000)) expireTag(...tags) return res.json() } diff --git a/tanstack-start/app/components/ThemeButton.tsx b/tanstack-start/app/components/ThemeButton.tsx index 213604a..f57a91a 100644 --- a/tanstack-start/app/components/ThemeButton.tsx +++ b/tanstack-start/app/components/ThemeButton.tsx @@ -6,8 +6,8 @@ const randomColorTheme = createServerFn().handler(async () => { method: 'PUT', }) - // Wait 1 second to stagger requests a little bit - await new Promise((resolve) => setTimeout(resolve, 1_000)) + // Wait 5 seconds to stagger requests a little bit + await new Promise((resolve) => setTimeout(resolve, 5_000)) return res.json() })