Tweaks to documentation
This commit is contained in:
24
Program.cs
24
Program.cs
@@ -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}");
|
||||
|
||||
@@ -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": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user