mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
ELECTRON-136 (Disable auto reload feature for r51 release) (#366)
- Disable this feature for r51 release - Remove commented code
This commit is contained in:
committed by
Vishwas Shashidhar
parent
0f2d52020d
commit
31b62eaef2
@@ -17,7 +17,6 @@ const { bringToFront } = require('./bringToFront.js');
|
|||||||
const eventEmitter = require('./eventEmitter');
|
const eventEmitter = require('./eventEmitter');
|
||||||
const { isMac } = require('./utils/misc');
|
const { isMac } = require('./utils/misc');
|
||||||
const { openScreenPickerWindow } = require('./desktopCapturer');
|
const { openScreenPickerWindow } = require('./desktopCapturer');
|
||||||
const { optimizeMemory } = require('./memoryMonitor');
|
|
||||||
|
|
||||||
const apiEnums = require('./enums/api.js');
|
const apiEnums = require('./enums/api.js');
|
||||||
const apiCmds = apiEnums.cmds;
|
const apiCmds = apiEnums.cmds;
|
||||||
@@ -148,11 +147,6 @@ electron.ipcMain.on(apiName, (event, arg) => {
|
|||||||
windowMgr.getMenu().popup(browserWin, { x: 20, y: 15, async: true });
|
windowMgr.getMenu().popup(browserWin, { x: 20, y: 15, async: true });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case apiCmds.optimizeMemoryConsumption:
|
|
||||||
if (typeof arg.memory === 'object' && typeof arg.memory.workingSetSize === 'number') {
|
|
||||||
optimizeMemory(arg.memory);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,10 +45,8 @@ function optimizeMemory(memoryInfo) {
|
|||||||
const mainWindow = getMainWindow();
|
const mainWindow = getMainWindow();
|
||||||
|
|
||||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||||
setIsAutoReload(true);
|
|
||||||
reloadedTimeStamp = new Date().getTime();
|
reloadedTimeStamp = new Date().getTime();
|
||||||
log.send(logLevels.INFO, 'Reloading the app to optimize memory usage');
|
log.send(logLevels.INFO, 'Reloading the app to optimize memory usage');
|
||||||
mainWindow.webContents.reload();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -326,22 +326,6 @@ function getTemplate(app) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Window/View menu -> separator
|
|
||||||
template[index].submenu.push({
|
|
||||||
type: 'separator',
|
|
||||||
});
|
|
||||||
|
|
||||||
// Window - View menu -> memoryRefresh
|
|
||||||
template[index].submenu.push({
|
|
||||||
label: 'Refresh app when idle',
|
|
||||||
type: 'checkbox',
|
|
||||||
checked: memoryRefresh,
|
|
||||||
click: function(item) {
|
|
||||||
memoryRefresh = item.checked;
|
|
||||||
updateConfigField('memoryRefresh', memoryRefresh);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!isMac) {
|
if (!isMac) {
|
||||||
template[index].submenu.push({
|
template[index].submenu.push({
|
||||||
label: 'Quit Symphony',
|
label: 'Quit Symphony',
|
||||||
|
|||||||
@@ -64,15 +64,6 @@ const throttledSetBadgeCount = throttle(1000, function(count) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Gathers renderer process memory
|
|
||||||
setInterval(() => {
|
|
||||||
const memory = process.getProcessMemoryInfo();
|
|
||||||
local.ipcRenderer.send(apiName, {
|
|
||||||
cmd: apiCmds.optimizeMemoryConsumption,
|
|
||||||
memory: memory
|
|
||||||
});
|
|
||||||
}, 1000 * 60 * 4);
|
|
||||||
|
|
||||||
createAPI();
|
createAPI();
|
||||||
|
|
||||||
// creates API exposed from electron.
|
// creates API exposed from electron.
|
||||||
|
|||||||
Reference in New Issue
Block a user