private static void StopMiner(IEnumerable <Process> processes) { foreach (var p in processes) { FileLogger.LogInfo($"{p.ProcessName} [PID: {p.Id}] stopped!"); p.Kill(); } }
private void LogError(FirebaseError error) { if (error == null) { return; } FileLogger.LogInfo(error.Code); Console.WriteLine(error.Code); }
public void ServiceStart() { FileLogger.LogInfo("Service starts"); Update("LastStart", DateTime.Now.ToNice()); var ip = new WebClient().DownloadString("http://bot.whatismyipaddress.com"); Push("ServiceStarts", $"{ip} : {DateTime.Now.ToNice()}"); }
private static void RunMiner(string programName, MinerConfig minerConfig) { try { var process = new Process { StartInfo = new ProcessStartInfo { FileName = programName, Arguments = minerConfig.Parameters, WorkingDirectory = minerConfig.ProgramFolder } }; process.Start(); process.PriorityClass = ProcessPriorityClass.High; Console.WriteLine($"{programName} started!"); } catch (Exception e) { FileLogger.LogInfo($"Starting {programName} failed! Error: {Environment.NewLine}{e}"); } }
public void Stop() { FileLogger.LogInfo("Service stops, Cancel token activated"); CancelTokenSource.Cancel(); }