Hangfire: SetRangeInHash

Created on 15 Feb 2019  路  5Comments  路  Source: HangfireIO/Hangfire

How come there is a SetRangeInHash method on both JobStorageConnection and IWriteOnlyTransaction ?

The two methods in SqlServer implementation used to be implemented quite the same but with the introduction of SqlCommandBatch, it was only the implementation in SqlServerConnection which was updated, not the method in SqlServerWriteOnlyTransaction.

question

Most helpful comment

Exactly the same, at least should be 馃槃

All 5 comments

It was 2014, and I didn't want to spawn the whole transaction to call just a single method. This was a wrong reason, but we can't do anything now, except, perhaps removing it in 2.0. What problem did you face with?

@odinserj no problem, i just stumpled upon this when going through changes to update my own Storage Provider and i was just curious why we would want two different implementations of what seems to be the same thing. Looked like Code Duplication to me and why one could call the other?

I simply didn't consider we can make a trivial change to remove this duplication, and in my opinion that's a non-easy task, especially in the dev branch.

Of course not. My initial question was also more on whether there is a difference in expected behavior - are the twho methods called in different scenarios expecting different behavior using the same input? Or are they exactly the same?

Exactly the same, at least should be 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cbmek picture cbmek  路  3Comments

dealproc picture dealproc  路  3Comments

cottsak picture cottsak  路  3Comments

plmwong picture plmwong  路  3Comments

nsnail picture nsnail  路  3Comments