Skip to content

Commit

Permalink
fix: disable swr for internal calls to avoid stalling cache
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 20, 2023
1 parent b449e38 commit 42d9984
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const runtimeConfig = useRuntimeConfig();

const commonCacheOptions: CacheOptions = {
group: "gh",
swr: true,
swr: false,
maxAge: 60 * 60 * 6, // 6 hours
staleMaxAge: 60 * 60 * 12, // 12 hours
};
Expand All @@ -16,8 +16,8 @@ const cacheOptions = (name: string): CacheOptions => ({
});

export const ghFetch = cachedFunction(
(url: string, opts: FetchOptions = {}) => {
return $fetch(url, {
<T=any>(url: string, opts: FetchOptions = {}) => {
return $fetch<T>(url, {
baseURL: "https://api.github.com",
...opts,
method: (opts.method || "GET").toUpperCase() as any,
Expand Down

0 comments on commit 42d9984

Please sign in to comment.