Skip to content

Commit

Permalink
Single UPDATE statement is enough for the SetJobParameter query
Browse files Browse the repository at this point in the history
  • Loading branch information
odinserj committed Oct 8, 2020
1 parent 0ad31c1 commit 7319063
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Hangfire.SqlServer/SqlServerConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ public override void SetJobParameter(string id, string name, string value)
begin try
update [{_storage.SchemaName}].JobParameter set Value = @value where JobId = @jobId and Name = @name;
if @@ROWCOUNT = 0 insert into [{_storage.SchemaName}].JobParameter (JobId, Name, Value) values (@jobId, @name, @value);
if @@ROWCOUNT = 0 update [{_storage.SchemaName}].JobParameter set Value = @value where JobId = @jobId and Name = @name;
end try
begin catch
IF ERROR_NUMBER() not in (2601, 2627) throw;
Expand Down

0 comments on commit 7319063

Please sign in to comment.