Tweaks to documentation

This commit is contained in:
2023-11-19 15:40:55 -05:00
parent 5db9b5f5c3
commit 499e0f2cc7
2 changed files with 21 additions and 22 deletions

View File

@@ -81,14 +81,24 @@ void ScheduleProcessStart(ProcessInfo processInfo)
var timer = new System.Threading.Timer(_ =>
{
ProcessStartInfo startInfo = new ProcessStartInfo
var runningProcesses = Process.GetProcessesByName(processInfo.Name);
if (runningProcesses.Length == 0)
{
FileName = processInfo.Path,
CreateNoWindow = !openInNewWindow, // Controlled by the user's choice
UseShellExecute = true, // Use the system shell to start the process
};
Process.Start(startInfo);
AppendToLogFile(processInfo, "run");
ProcessStartInfo startInfo = new ProcessStartInfo
{
FileName = processInfo.Path,
CreateNoWindow = !openInNewWindow, // Controlled by the user's choice
UseShellExecute = true, // Use the system shell to start the process
};
Process.Start(startInfo);
AppendToLogFile(processInfo, "run");
}
else
{
Console.WriteLine($"Process still running {processInfo.Name} at {DateTime.Now}, skipping for next interval");
AppendToLogFile(processInfo, "skipped");
}
}, null, delay, Timeout.InfiniteTimeSpan); // Run only once
Console.WriteLine($"Scheduled {processInfo.Name} to start at {scheduledTime}");

View File

@@ -1,23 +1,12 @@
{
"processes": [
{
"name": "Chann3l.WebJob",
"count": 4,
"enable": false,
"path": "C:\\Solutions\\chann3ls\\Chann3l.MessageJob\\bin\\Debug\\Chann3l.WebJob.exe"
},
{
"name": "Chann3l.SymbolJob",
"count": 6,
"enable": false,
"path": "C:\\Solutions\\chann3ls\\Chann3l.SymbolJob\\bin\\Debug\\Chann3l.SymbolJob.exe"
},
{
"name": "Chann3l.StockJob",
"count": 1,
"name": "",
"count": 3,
"enable": true,
"interval": 5,
"path": "C:\\Solutions\\chann3ls\\Chann3l.StockJob\\bin\\Debug\\Chann3l.StockJob.exe"
"time": "15:25",
"path": ""
}
]
}