public static void SendHeartbeat(PythonCliParameters cliParameters)
{
var pythonBinary = PythonManager.GetPython();
if (pythonBinary != null)
{
var process = new RunProcess(pythonBinary, cliParameters.ToArray());
if (WakaTimeConfigFile.Debug)
{
Logger.Debug(string.Format("[\"{0}\", \"{1}\"]", pythonBinary, string.Join("\", \"", cliParameters.ToArray(true))));
process.Run();
Logger.Debug(string.Format("CLI STDOUT: {0}", process.Output));
Logger.Debug(string.Format("CLI STDERR: {0}", process.Error));
}
else
{
process.RunInBackground();
}
if (!process.Success)
{
Logger.Error(string.Format("Could not send heartbeat: {0}", process.Error));
}
}
else
{
Logger.Error("Could not send heartbeat because python is not installed");
}
}