private bool MenuOptionExit() { Console.Clear(); Finalizer.DoFinalize(); Environment.Exit(0); return(Terminate); }
private bool MenuOptionStartMiners() { Console.Clear(); if (KillMiners() && RunConfigurationModel.MinerStartDelay > 0) { Console.WriteLine($@"Waiting {RunConfigurationModel.MinerStartDelay} second(s) before starting new miner(s)."); Thread.Sleep(RunConfigurationModel.MinerStartDelay * 1000); } Finalizer.DoFinalize(); Runner.Run(_masterConfigurationModel); return(Terminate); }
public void Run() { if (!ConfigurationModel.IsValid) { return; } _handler = ConsoleEventCallback; SetConsoleCtrlHandler(_handler, true); try { while (true) { Job.Execute(); if (ConfigurationModel.ContinuousMode) { continue; } if (ConfigurationModel.GenerateConfigurationOnly) { break; } Console.WriteLine(@"Waiting 30 seconds before finalization."); Thread.Sleep(30000); break; } } catch (Exception e) { Console.WriteLine(@"Unexpected error occured: "); Console.WriteLine(e); } finally { Finalizer?.DoFinalize(); } }
private bool ConsoleEventCallback(int eventType) { Finalizer?.DoFinalize(); return(false); }