Skip to content

Commit

Permalink
SqlAgDatabase: Fixes Issue dsccommunity#1743
Browse files Browse the repository at this point in the history
  • Loading branch information
dlenkov committed Apr 19, 2022
1 parent d8b4d9d commit 48882d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Changes to SqlAGDatabase
- Added StatementTimeout parameter with value 0 (no timeout) to Connect-SQL invocation in Set-TargetResource function to fix Issue#1743
This prevents timeout during backup operation on secondary.

### Removed

- The deprecated DSC resource SqlDatabaseOwner have been removed _(and replaced_
Expand Down
3 changes: 1 addition & 2 deletions source/DSCResources/DSC_SqlAGDatabase/DSC_SqlAGDatabase.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function Set-TargetResource
Import-SQLPSModule

# Connect to the defined instance
$serverObject = Connect-SQL -ServerName $ServerName -InstanceName $InstanceName
$serverObject = Connect-SQL -ServerName $ServerName -InstanceName $InstanceName -StatementTimeout 0

# Get the Availability Group
$availabilityGroup = $serverObject.AvailabilityGroups[$AvailabilityGroupName]
Expand Down Expand Up @@ -576,7 +576,6 @@ function Set-TargetResource
$restoreLogQueryStringBuilder.AppendLine() | Out-Null
$restoreLogQueryStringBuilder.Append('REVERT') | Out-Null
}

$restoreLogQueryString = $restoreLogQueryStringBuilder.ToString()
}

Expand Down

0 comments on commit 48882d3

Please sign in to comment.