Skip to content

Commit 2ce99db

Browse files
When running the installer engine (via SCMU or PowerShell) we can assume it is Windows, and thus we can set the shutdown timeout to 2 minutes
1 parent 9c0ab38 commit 2ce99db

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/ServiceControlInstaller.Engine/Configuration/ServiceControl/ServiceControlAppConfig.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ protected override void UpdateSettings()
3232
settings.Set(ServiceControlSettings.EnableFullTextSearchOnBodies, details.EnableFullTextSearchOnBodies.ToString(), version);
3333
settings.Set(ServiceControlSettings.RemoteInstances, RemoteInstanceConverter.ToJson(details.RemoteInstances), version);
3434

35+
// Windows services allow a maximum of 125 seconds when stopping a service.
36+
// When shutting down or restarting the OS we have no control over the
37+
// shutdown timeout. This is by the installer engine that is run _only_ on
38+
// Windows via SCMU or PowerShell
39+
settings.Set(ServiceControlSettings.ShutdownTimeout, "00:02:00");
40+
3541
// Retired settings
3642
settings.RemoveIfRetired(ServiceControlSettings.AuditQueue, version);
3743
settings.RemoveIfRetired(ServiceControlSettings.AuditLogQueue, version);

src/ServiceControlInstaller.Engine/Configuration/ServiceControl/SettingsList.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,11 @@ public static class ServiceControlSettings
8989
Name = "ServiceControl/EnableFullTextSearchOnBodies",
9090
SupportedFrom = new SemanticVersion(4, 17, 0)
9191
};
92+
93+
public static SettingInfo ShutdownTimeout = new()
94+
{
95+
Name = "ServiceControl/ShutdownTimeout",
96+
SupportedFrom = new SemanticVersion(6, 4, 0)
97+
};
9298
}
9399
}

0 commit comments

Comments
 (0)