From 91f9ac8cf96695828d92e96251945a5ca08d861e Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Mon, 25 Mar 2024 17:29:24 -0700 Subject: [PATCH] Mark class internal and use static instance --- Snowflake.Data/Client/SnowflakeDbCommand.cs | 2 +- Snowflake.Data/Core/QueryResultsAwaiter.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Snowflake.Data/Client/SnowflakeDbCommand.cs b/Snowflake.Data/Client/SnowflakeDbCommand.cs index 1cf70e464..ce004df5c 100755 --- a/Snowflake.Data/Client/SnowflakeDbCommand.cs +++ b/Snowflake.Data/Client/SnowflakeDbCommand.cs @@ -24,7 +24,7 @@ public class SnowflakeDbCommand : DbCommand private SFLogger logger = SFLoggerFactory.GetLogger(); - private QueryResultsAwaiter _queryResultsAwaiter = new QueryResultsAwaiter(); + private readonly QueryResultsAwaiter _queryResultsAwaiter = QueryResultsAwaiter.Instance; public SnowflakeDbCommand() { diff --git a/Snowflake.Data/Core/QueryResultsAwaiter.cs b/Snowflake.Data/Core/QueryResultsAwaiter.cs index 5a9bc0744..5ea187fbe 100644 --- a/Snowflake.Data/Core/QueryResultsAwaiter.cs +++ b/Snowflake.Data/Core/QueryResultsAwaiter.cs @@ -11,7 +11,7 @@ namespace Snowflake.Data.Core { - public class QueryResultsRetryConfig + internal class QueryResultsRetryConfig { private const int DefaultAsyncNoDataMaxRetry = 24; @@ -42,6 +42,8 @@ internal class QueryResultsAwaiter private QueryResultsRetryConfig _queryResultsRetryConfig; + internal static readonly QueryResultsAwaiter Instance = new QueryResultsAwaiter(); + internal QueryResultsAwaiter() { _queryResultsRetryConfig = new QueryResultsRetryConfig();