mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Added extra logging to update/ProcessProvider
This commit is contained in:
parent
50c4aa7557
commit
0884fa617a
6 changed files with 45 additions and 12 deletions
|
@ -84,21 +84,22 @@ namespace NzbDrone.Update
|
|||
VerfityArguments(args);
|
||||
int processId = ParseProcessId(args);
|
||||
|
||||
FileInfo exeFileInfo = new FileInfo(_processProvider.GetProcessById(processId).StartPath);
|
||||
string appPath = exeFileInfo.Directory.FullName;
|
||||
var exeFileInfo = new FileInfo(_processProvider.GetProcessById(processId).StartPath);
|
||||
string targetFolder = exeFileInfo.Directory.FullName;
|
||||
|
||||
logger.Info("Starting update process");
|
||||
_updateProvider.Start(appPath);
|
||||
logger.Info("Starting update process. Target Path:{0}", targetFolder);
|
||||
_updateProvider.Start(targetFolder);
|
||||
}
|
||||
|
||||
private int ParseProcessId(string[] args)
|
||||
{
|
||||
int id = 0;
|
||||
int id;
|
||||
if (!Int32.TryParse(args[0], out id) || id <= 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("Invalid process id: " + args[0]);
|
||||
}
|
||||
|
||||
logger.Debug("NzbDrone processId:{0}", id);
|
||||
return id;
|
||||
}
|
||||
|
||||
|
@ -106,6 +107,8 @@ namespace NzbDrone.Update
|
|||
{
|
||||
if (args == null || args.Length != 2)
|
||||
throw new ArgumentException("Wrong number of parameters were passed in.");
|
||||
|
||||
logger.Debug("Arguments verified. [{0}] , [{1}]", args[0], args[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue