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:
1 parent
a988a33d21
commit
dd9e84a0db
3 files changed
+299
-35
No files matched your search
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user