Skip to content

Commit

Permalink
chore: Add revalidate option to fetch API call
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Jan 18, 2025
1 parent af3f2a4 commit 41b1ab0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/romanize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export async function romanize(input: string): Promise<string> {
early_stopping: true,
},
}),
next: {
revalidate: 60 * 60 * 24 * 7,
},
signal: AbortSignal.timeout(5000),
});

if (!response.ok) {
Expand Down
3 changes: 3 additions & 0 deletions src/api/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export async function translate(
inputs: [prompt],
parameters,
}),
next: {
revalidate: 60 * 60 * 24 * 7,
},
signal: AbortSignal.timeout(5000),
});

Expand Down

0 comments on commit 41b1ab0

Please sign in to comment.