You've already forked Sonarr
							
							
				mirror of
				https://github.com/Sonarr/Sonarr.git
				synced 2025-10-31 00:07:55 +02:00 
			
		
		
		
	GetCurrentProcessId for PidFileProvider
This commit is contained in:
		| @@ -33,7 +33,7 @@ namespace NzbDrone.Common.Processes | ||||
|             var filename = Path.Combine(_appFolderInfo.AppDataFolder, "nzbdrone.pid"); | ||||
|             try | ||||
|             { | ||||
|                 File.WriteAllText(filename, _processProvider.GetCurrentProcess().Id.ToString()); | ||||
|                 File.WriteAllText(filename, _processProvider.GetCurrentProcessId().ToString()); | ||||
|             } | ||||
|             catch (Exception ex) | ||||
|             { | ||||
|   | ||||
| @@ -12,6 +12,7 @@ namespace NzbDrone.Common.Processes | ||||
| { | ||||
|     public interface IProcessProvider | ||||
|     { | ||||
|         int GetCurrentProcessId(); | ||||
|         ProcessInfo GetCurrentProcess(); | ||||
|         ProcessInfo GetProcessById(int id); | ||||
|         List<ProcessInfo> FindProcessByName(string name); | ||||
| @@ -40,6 +41,11 @@ namespace NzbDrone.Common.Processes | ||||
|             _logger = logger; | ||||
|         } | ||||
| 
 | ||||
|         public int GetCurrentProcessId() | ||||
|         { | ||||
|             return Process.GetCurrentProcess().Id; | ||||
|         } | ||||
| 
 | ||||
|         public ProcessInfo GetCurrentProcess() | ||||
|         { | ||||
|             return ConvertToProcessInfo(Process.GetCurrentProcess()); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user