CadyIO / hangfire-ravendb

RavenDB job storage for Hangfire
https://www.nuget.org/packages/Hangfire.Raven/
18 stars 35 forks source link

RecurringJob.RemoveIfExists throws an object reference not set exception #17

Closed WilkoSki closed 7 years ago

WilkoSki commented 7 years ago

Any attempt to use RecurringJob.RemoveIfExists with throw an object reference not set exception if the job id doesn't exist in the underlying RavenDb storage.

The exception originates in the Hangfire.Raven.RavenWriteOnlyTransaction.RemoveFromSet method.

This behaviour is not consistent with other Hangfire storage implementations, they will remove the job if it exists and won't throw an exception if it doesn't. See the documentation at the following link:

http://docs.hangfire.io/en/latest/background-methods/performing-recurrent-tasks.html

AustinWinstanley commented 7 years ago

Ok, I'll take a look at this as soon as I get a chance.

mjohnson0580 commented 7 years ago

This should be fixed in pull request #19.