Fix AI suggestions query running twice
Build and Push Docker Image / build (push) Successful in 9m8s
Details
Build and Push Docker Image / build (push) Successful in 9m8s
Details
Disable automatic refetching for expensive AI assignment query: - Set staleTime to Infinity (never auto-refetch) - Disable refetchOnWindowFocus, refetchOnReconnect, refetchOnMount - Only manual refresh via button will trigger new request Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c45a428d8b
commit
148925cb95
|
|
@ -89,10 +89,16 @@ function AssignmentManagementContent({ roundId }: { roundId: string }) {
|
|||
{ enabled: !!round && !useAI }
|
||||
)
|
||||
|
||||
// AI-powered suggestions
|
||||
// AI-powered suggestions (expensive - disable auto refetch)
|
||||
const { data: aiSuggestionsRaw, isLoading: loadingAI, refetch: refetchAI } = trpc.assignment.getAISuggestions.useQuery(
|
||||
{ roundId, useAI: true },
|
||||
{ enabled: !!round && useAI }
|
||||
{
|
||||
enabled: !!round && useAI,
|
||||
staleTime: Infinity, // Never consider stale (only refetch manually)
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false,
|
||||
}
|
||||
)
|
||||
|
||||
// Normalize AI suggestions to match algorithmic format
|
||||
|
|
|
|||
Loading…
Reference in New Issue