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();