From d2bf4175fe5ae40454b0b4cabf3eb26ecc580c93 Mon Sep 17 00:00:00 2001 From: Sergey Odinokov Date: Tue, 26 Nov 2024 10:14:09 +0700 Subject: [PATCH] Update SqlServerJobQueue.cs --- src/Hangfire.SqlServer/SqlServerJobQueue.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hangfire.SqlServer/SqlServerJobQueue.cs b/src/Hangfire.SqlServer/SqlServerJobQueue.cs index 757a9e258..55dd9fa5b 100644 --- a/src/Hangfire.SqlServer/SqlServerJobQueue.cs +++ b/src/Hangfire.SqlServer/SqlServerJobQueue.cs @@ -78,7 +78,7 @@ public void Enqueue(DbConnection connection, DbTransaction transaction, string q var query = _storage.GetQueryFromTemplate(static schemaName => $@"insert into [{schemaName}].JobQueue (JobId, Queue) values (@jobId, @queue)"); - var command = ((DbConnection)connection).Create(query, timeout: _storage.CommandTimeout); + using var command = ((DbConnection)connection).Create(query, timeout: _storage.CommandTimeout); command.AddParameter("@jobId", long.Parse(jobId, CultureInfo.InvariantCulture), DbType.Int64); command.AddParameter("@queue", queue, DbType.String);