Skip to content

DRY: Stop timeout calculation duplicated in 3 locations #414

@Christophe-Rogiers

Description

@Christophe-Rogiers

Description

The same timeout calculation logic appears in three places:

  • src/Servy.Core/Services/ServiceManager.csInstallServiceAsync() (lines 413–421)
  • src/Servy.Core/Services/ServiceManager.csStopServiceAsync() (lines 672–679)
  • src/Servy.Core/Helpers/ServiceHelper.csStopServices() (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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions