mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
Fixed an upgrade/service bug where it would try to stop an already stopped service.
This commit is contained in:
parent
9dbc97223f
commit
e35a4bf8ac
6 changed files with 54 additions and 17 deletions
|
@ -100,17 +100,24 @@ namespace NzbDrone.Common
|
|||
|
||||
Logger.Info("Service is currently {0}", service.Status);
|
||||
|
||||
service.Stop();
|
||||
service.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(60));
|
||||
|
||||
service.Refresh();
|
||||
if (service.Status == ServiceControllerStatus.Stopped)
|
||||
if (service.Status != ServiceControllerStatus.Stopped)
|
||||
{
|
||||
Logger.Info("{0} has stopped successfully.");
|
||||
service.Stop();
|
||||
service.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(60));
|
||||
|
||||
service.Refresh();
|
||||
if (service.Status == ServiceControllerStatus.Stopped)
|
||||
{
|
||||
Logger.Info("{0} has stopped successfully.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Error("Service stop request has timed out. {0}", service.Status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Error("Service stop request has timed out. {0}", service.Status);
|
||||
Logger.Warn("Service {0} is already in stopped state.", service.ServiceName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue