Skip to content

Commit

Permalink
Bit extra data
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceredron committed Aug 1, 2024
1 parent 15eb81f commit 4635e44
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Altinn.Broker.Persistence/DatabaseConnectionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public NpgsqlConnection GetOrCreateConnection()
private async Task EnsureValidDataSource()
{
await _semaphore.WaitAsync();
var stopwatch = System.Diagnostics.Stopwatch.StartNew();
try
{
NpgsqlConnectionStringBuilder connectionStringBuilder = new NpgsqlConnectionStringBuilder(_connectionString);
Expand All @@ -71,6 +72,7 @@ private async Task EnsureValidDataSource()
}
finally
{
_logger.LogDebug('DB Connection milliseconds: {time}', stopwatch.ElapsedMilliseconds);
_semaphore.Release();
}
}
Expand Down

0 comments on commit 4635e44

Please sign in to comment.