new commit

This commit is contained in:
Aaron Davis 2024-11-04 07:55:41 -08:00
parent 602a8810af
commit 1c43da79d7
15 changed files with 20 additions and 9 deletions

View file

@ -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.

View file

@ -51,5 +51,6 @@
"xvfb",
"Yuya"
],
"i18n-ally.keystyle": "nested"
"i18n-ally.keystyle": "nested",
"makefile.configureOnOpen": false
}

View file

@ -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[]) {

View file

@ -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}`);
});
}