Skip to content

Commit

Permalink
stagger more
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Nov 21, 2024
1 parent 9e5dc37 commit 886d341
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions next-canary/src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
4 changes: 2 additions & 2 deletions tanstack-start/app/components/ThemeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down

0 comments on commit 886d341

Please sign in to comment.