mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 22:15:33 +00:00
fix(cliproxy): make version cache backend-specific for proper switching
- Add backend parameter to version cache functions (read/write/path)
- Store cache at bin/{backend}/.version-cache.json instead of shared location
- Pass backend through checkForUpdates() and BinaryManager
- Add refetchType: 'all' to force immediate query refetch on backend change
- Add cliproxy-server-config query invalidation for consistency
This commit is contained in:
1 parent
0511c5e2fd
commit
a41fd2a093
4 files changed
+34
-17
No files matched your search
@@ -353,8 +353,10 @@ export function useUpdateBackend() {
|
||||
api.cliproxyServer.updateBackend(backend, force),
|
||||
onSuccess: () => {
|
||||
// Invalidate all queries that depend on backend setting
|
||||
queryClient.invalidateQueries({ queryKey: ['cliproxy-update-check'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['cliproxy-versions'] });
|
||||
// Use refetchType: 'all' to force immediate refetch even if query is stale
|
||||
queryClient.invalidateQueries({ queryKey: ['cliproxy-update-check'], refetchType: 'all' });
|
||||
queryClient.invalidateQueries({ queryKey: ['cliproxy-versions'], refetchType: 'all' });
|
||||
queryClient.invalidateQueries({ queryKey: ['cliproxy-server-config'], refetchType: 'all' });
|
||||
queryClient.invalidateQueries({ queryKey: ['proxy-status'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['cliproxy-stats'] });
|
||||
toast.success('Backend updated');
|
||||
|
||||
Reference in new issue
Block a user