From 4c98dda0f50a9eb564ff8e949d4f1cb0cfa05325 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Tue, 28 Mar 2023 14:30:43 +0200 Subject: [PATCH] `Restart-SqlService`: Correctly evaluate timeout value (#1890) - SqlServerDsc.Common - The command `Restart-SqlService` was updated to correctly evaluate when the timeout value is reached (issue #1889). --- CHANGELOG.md | 3 +++ source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94e77b64d..f0b2438f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 is more correct and not a duplicate. - Integration tests configuration names was renamed to better tell what the configuration does ([issue #1880](https://github.com/dsccommunity/SqlServerDsc/issues/1880)). +- SqlServerDsc.Common + - The command `Restart-SqlService` was updated to correctly evaluate when + the timeout value is reached ([issue #1889](https://github.com/dsccommunity/SqlServerDsc/issues/1889)). ## [16.1.0] - 2023-02-28 diff --git a/source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 b/source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 index d325cd886..d4cf3ddd4 100644 --- a/source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 +++ b/source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 @@ -1030,7 +1030,7 @@ function Restart-SqlService # Waiting 2 seconds to not hammer the SQL Server instance. Start-Sleep -Seconds 2 - } until ($connectTimer.Elapsed.Seconds -ge $Timeout) + } until ($connectTimer.Elapsed.TotalSeconds -ge $Timeout) $connectTimer.Stop()