mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-02-09 01:16:49 +00:00
Use Environment.ProcessPath instead of GetCurrentProcess().MainModule.FileName
GetCurrentProcess().MainModule.FileName is expensive, Environment.ProcessPath added in net6 (cherry picked from commit f928ee7cad304115a002da00e218fb987e02b279) Close #2260
This commit is contained in:
@@ -65,7 +65,7 @@ namespace NzbDrone.Common
|
||||
|
||||
var args = $"create {serviceName} " +
|
||||
$"DisplayName= \"{serviceName}\" " +
|
||||
$"binpath= \"{Process.GetCurrentProcess().MainModule.FileName}\" " +
|
||||
$"binpath= \"{Environment.ProcessPath}\" " +
|
||||
"start= auto " +
|
||||
"depend= EventLog/Tcpip/http " +
|
||||
"obj= \"NT AUTHORITY\\LocalService\"";
|
||||
|
||||
@@ -47,7 +47,9 @@ namespace NzbDrone.Host
|
||||
{
|
||||
try
|
||||
{
|
||||
Logger.Info("Starting Readarr - {0} - Version {1}", Assembly.GetCallingAssembly().Location, Assembly.GetExecutingAssembly().GetName().Version);
|
||||
Logger.Info("Starting Readarr - {0} - Version {1}",
|
||||
Environment.ProcessPath,
|
||||
Assembly.GetExecutingAssembly().GetName().Version);
|
||||
|
||||
var startupContext = new StartupContext(args);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user