feat(usage): enable background query for usage polling

- Add `refetchIntervalInBackground: true` to usage query configuration
- Allows usage queries to continue running when app window is minimized or unfocused
- Existing safety mechanisms remain in place (timeout limits, minimum interval, no retry)
- Users have full control through autoQueryInterval setting
This commit is contained in:
Jason
2025-11-08 00:02:28 +08:00
parent b617879035
commit 52a7f9d313

View File

@@ -103,6 +103,7 @@ export const useUsageQuery = (
autoQueryInterval > 0
? Math.max(autoQueryInterval, 1) * 60 * 1000 // 最小1分钟
: false,
refetchIntervalInBackground: true, // 后台也继续定时查询
refetchOnWindowFocus: false,
retry: false,
staleTime: 0, // 不使用缓存策略,确保 refetchInterval 准确执行