Description
The same timeout calculation logic appears in three places:
src/Servy.Core/Services/ServiceManager.cs — InstallServiceAsync() (lines 413–421)
src/Servy.Core/Services/ServiceManager.cs — StopServiceAsync() (lines 672–679)
src/Servy.Core/Helpers/ServiceHelper.cs — StopServices() (lines 163–171)
Each computes: max(max(stopTimeout + buffer, previousStopTimeout + buffer), defaultTimeout) plus optional pre-stop addition.
Suggested fix
Extract a shared CalculateStopTimeout() utility method in Servy.Core.
Description
The same timeout calculation logic appears in three places:
src/Servy.Core/Services/ServiceManager.cs—InstallServiceAsync()(lines 413–421)src/Servy.Core/Services/ServiceManager.cs—StopServiceAsync()(lines 672–679)src/Servy.Core/Helpers/ServiceHelper.cs—StopServices()(lines 163–171)Each computes:
max(max(stopTimeout + buffer, previousStopTimeout + buffer), defaultTimeout)plus optional pre-stop addition.Suggested fix
Extract a shared
CalculateStopTimeout()utility method inServy.Core.