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:
@@ -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 准确执行
|
||||
|
||||
Reference in New Issue
Block a user