mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Electron-136 (Optimize memory by reloading the app when the user is idle) (#335)
- Refresh app when memory exceeds the threshold and if user is inactive - Add logic to reload app when memory exceeds threshold and if user is inactive - Add reload threshold - Fix unit test
This commit is contained in:
committed by
Vishwas Shashidhar
parent
2e25c97bec
commit
2de86c8003
@@ -17,6 +17,7 @@ const { bringToFront } = require('./bringToFront.js');
|
||||
const eventEmitter = require('./eventEmitter');
|
||||
const { isMac } = require('./utils/misc');
|
||||
const { openScreenPickerWindow } = require('./desktopCapturer');
|
||||
const { optimizeMemory } = require('./memoryMonitor');
|
||||
|
||||
const apiEnums = require('./enums/api.js');
|
||||
const apiCmds = apiEnums.cmds;
|
||||
@@ -147,6 +148,11 @@ electron.ipcMain.on(apiName, (event, arg) => {
|
||||
windowMgr.getMenu().popup(browserWin, { x: 20, y: 15, async: true });
|
||||
}
|
||||
break;
|
||||
case apiCmds.optimizeMemoryConsumption:
|
||||
if (typeof arg.memory === 'object' && typeof arg.memory.workingSetSize === 'number') {
|
||||
optimizeMemory(arg.memory);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user