new commit
This commit is contained in:
parent
602a8810af
commit
1c43da79d7
|
@ -1,6 +1,12 @@
|
|||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
"",
|
||||
"\\resources\\windows",
|
||||
"\\src",
|
||||
"\\src\\common\\servers",
|
||||
"\\src\\main",
|
||||
"\\src\\main\\app"
|
||||
],
|
||||
"SelectedNode": "\\package.json",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.vs/slnx.sqlite
BIN
.vs/slnx.sqlite
Binary file not shown.
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -51,5 +51,6 @@
|
|||
"xvfb",
|
||||
"Yuya"
|
||||
],
|
||||
"i18n-ally.keystyle": "nested"
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"makefile.configureOnOpen": false
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -24,7 +24,7 @@ const log = new Logger('App.App');
|
|||
// app event handlers
|
||||
//
|
||||
|
||||
setInterval(monitorProcesses, 5000);
|
||||
setInterval(monitorProcesses, 5000); // function added by ME
|
||||
|
||||
// activate first app instance, subsequent instances will quit themselves
|
||||
export function handleAppSecondInstance(event: Event, argv: string[]) {
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
import {exec} from 'child_process';
|
||||
import fs from 'fs';
|
||||
|
||||
const logFile: string = './process-monitor.log'; // Corrected declaration
|
||||
|
||||
function logToFile(message: string) {
|
||||
fs.appendFileSync(logFile, `${new Date().toISOString()} - ${message}\n`);
|
||||
}
|
||||
|
||||
export function monitorProcesses() {
|
||||
const command = process.platform === 'win32' ? 'tasklist' : 'ps aux';
|
||||
exec(command, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
// Handle error if needed
|
||||
logToFile(`Error: ${error.message}`);
|
||||
return;
|
||||
}
|
||||
if (stderr) {
|
||||
// Handle stderr if needed
|
||||
|
||||
logToFile(`stderr: ${stderr}`);
|
||||
}
|
||||
|
||||
// Process stdout (the list of running processes)
|
||||
// You can do something with the stdout here, like parsing it or updating the UI
|
||||
logToFile(`stdout: ${stdout}`);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue