Skip to content

Commit

Permalink
feat(frontend): shorten spotify revalidation time
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-h1 committed Jan 17, 2024
1 parent 3d0c0b2 commit a068062
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/api/now-playing/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import spotifyService from '@frontend/services/spotifyService';
import { SongItem } from '@frontend/types/spotify';

export const revalidate = 8;
export const revalidate = 5;

export async function GET() {
const res = await spotifyService.getNowPlaying();
Expand Down
2 changes: 1 addition & 1 deletion src/components/NowPlaying/NowPlaying.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const AnimatedBars = () => {
export default function NowPlaying() {
const { isMounted } = useMounted();
const { data, error, isLoading } = useSWR<Song>(`/api/now-playing`, fetcher, {
refreshInterval: 8000,
refreshInterval: 5000,
fallback: {
isPlaying: false,
title: 'Not Playing',
Expand Down

0 comments on commit a068062

Please sign in to comment.