imranmomin / Hangfire.AzureCosmosDb

Azure Cosmos DB storage provider for Hangfire
https://www.hangfire.io/
MIT License
18 stars 17 forks source link

Doesn't implement Hangfires new HasFeature method introduced with 1.8.0 #59

Open CommanderAlchemy opened 8 months ago

CommanderAlchemy commented 8 months ago

Hi,

Root issue: https://github.com/HangfireIO/Hangfire/issues/2319

Similar issue and more detailed can be found at: https://github.com/GeXiaoguo/Hangfire.MAMQSqlExtension/issues/14

TLDR: Updating Hangfire did depricate and change some things in AddOrUpdate, but queue is still there.

RecurringJob.AddOrUpdate<IUrlCallerService>(
    job.Description,
    job.Queue,
    methodCall: callerService => callerService
        .GetAsync(job, CancellationToken.None),
    cronExpression: job.CronExpression

This will now throw:

System.NotSupportedException: Current storage doesn't support specifying queues directly for a specific job. Please use the QueueAttribute instead.
   at Hangfire.RecurringJobManager.AddOrUpdate(String recurringJobId, Job job, String cronExpression, RecurringJobOptions options)