mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-16 13:40:24 +02:00
attempt to optimize the tagList query
- this query in some cases can return a very large amount of data, depending on the size of the user's library - increasing the cacheTime reduces the frequency of fetches while disabling structuralSharing reduces the need for react-query to do a deep equality comparison for the cache
This commit is contained in:
@@ -30,7 +30,7 @@ export const sharedQueries = {
|
|||||||
},
|
},
|
||||||
tagList: (args: QueryHookArgs<TagListQuery>) => {
|
tagList: (args: QueryHookArgs<TagListQuery>) => {
|
||||||
return queryOptions({
|
return queryOptions({
|
||||||
gcTime: 1000 * 60,
|
gcTime: 1000 * 60 * 24,
|
||||||
queryFn: ({ signal }) => {
|
queryFn: ({ signal }) => {
|
||||||
return api.controller.getTagList({
|
return api.controller.getTagList({
|
||||||
apiClientProps: { serverId: args.serverId, signal },
|
apiClientProps: { serverId: args.serverId, signal },
|
||||||
@@ -38,7 +38,8 @@ export const sharedQueries = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
queryKey: queryKeys.tags.list(args.serverId || '', args.query.type),
|
queryKey: queryKeys.tags.list(args.serverId || '', args.query.type),
|
||||||
staleTime: 1000 * 60,
|
staleTime: 1000 * 60 * 24,
|
||||||
|
structuralSharing: false,
|
||||||
...args.options,
|
...args.options,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user