From 919fd31f5c941c0a9132fdc07442988bf25ecb4a Mon Sep 17 00:00:00 2001 From: Sergey Galuzo Date: Tue, 1 Aug 2023 16:03:20 -0700 Subject: [PATCH] Enable defrag by default. --- .../Features/Watchdogs/DefragWatchdog.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.Health.Fhir.SqlServer/Features/Watchdogs/DefragWatchdog.cs b/src/Microsoft.Health.Fhir.SqlServer/Features/Watchdogs/DefragWatchdog.cs index 59148c9bfa..2406306b92 100644 --- a/src/Microsoft.Health.Fhir.SqlServer/Features/Watchdogs/DefragWatchdog.cs +++ b/src/Microsoft.Health.Fhir.SqlServer/Features/Watchdogs/DefragWatchdog.cs @@ -308,10 +308,12 @@ INSERT INTO dbo.Parameters (Id,Number) SELECT @ThreadsId, 4 INSERT INTO dbo.Parameters (Id,Number) SELECT @HeartbeatPeriodSecId, 60 INSERT INTO dbo.Parameters (Id,Number) SELECT @HeartbeatTimeoutSecId, 600 INSERT INTO dbo.Parameters (Id,Char) SELECT name, 'LogEvent' FROM sys.objects WHERE type = 'p' AND name LIKE '%defrag%' +INSERT INTO dbo.Parameters (Id,Number) SELECT @IsEnabledId, 1 "); cmd.Parameters.AddWithValue("@ThreadsId", ThreadsId); cmd.Parameters.AddWithValue("@HeartbeatPeriodSecId", HeartbeatPeriodSecId); cmd.Parameters.AddWithValue("@HeartbeatTimeoutSecId", HeartbeatTimeoutSecId); + cmd.Parameters.AddWithValue("@IsEnabledId", IsEnabledId); await cmd.ExecuteNonQueryAsync(_sqlRetryService, _logger, CancellationToken.None); _threads = await GetThreadsAsync(CancellationToken.None);