Exemplo n.º 1
0
 private static void StopMiner(IEnumerable <Process> processes)
 {
     foreach (var p in processes)
     {
         FileLogger.LogInfo($"{p.ProcessName} [PID: {p.Id}] stopped!");
         p.Kill();
     }
 }
Exemplo n.º 2
0
 private void LogError(FirebaseError error)
 {
     if (error == null)
     {
         return;
     }
     FileLogger.LogInfo(error.Code);
     Console.WriteLine(error.Code);
 }
Exemplo n.º 3
0
        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()}");
        }
Exemplo n.º 4
0
 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}");
     }
 }
Exemplo n.º 5
0
 public void Stop()
 {
     FileLogger.LogInfo("Service stops, Cancel token activated");
     CancelTokenSource.Cancel();
 }