feat: implement smart foreground quota refresh with debounce

- Trigger immediate quota poll when main window gains focus.
- Add 10s debounce to prevent API spam on frequent window switching.
- Add concurrency guard to prevent overlapping poll requests.
- Reset background polling interval after manual refresh.
- Add unit tests for polling, debounce, and concurrency logic.
This commit is contained in:
Draculabo committed 2026-01-28 12:58:35 +08:00
1 parent a988a33d21
commit dd9e84a0db
3 files changed
+299 -35

No files matched your search

+4
View File
@@ -144,6 +144,10 @@ function createWindow() {
const { level, message, lineNumber, sourceId } = details;
logger.info(`[Renderer Console][${level}] ${message} (${sourceId}:${lineNumber})`);
});
mainWindow.on('focus', () => {
CloudMonitorService.handleAppFocus();
});
}
app.on('child-process-gone', (event, details) => {