imranmomin / Hangfire.AzureCosmosDb

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

Jobs never being executed #50

Open RomanKreisel opened 2 years ago

RomanKreisel commented 2 years ago

I have a pretty standard setup (using ASP.NET Core 6, following examples from hangfire.io and this github page), but the jobs are never being executed.

imranmomin commented 2 years ago

@RomanKreisel - do you have a repo where I can reproduce at my end

f1nzer commented 2 years ago

@imranmomin on my local machine this situation can be reproduced by replacing https://github.com/imranmomin/Hangfire.AzureCosmosDb/blob/6e6b0400f02b4cf490edd2e29f278892ccaf8afa/sample/Program.cs#L37 with another overload (using CosmosClient instance in parameters):

o.UseAzureCosmosDbStorage(new CosmosClient(url, secretKey, cosmoClientOptions), database, collection);

Also, this line should be removed because it is redundant. https://github.com/imranmomin/Hangfire.AzureCosmosDb/blob/6e6b0400f02b4cf490edd2e29f278892ccaf8afa/sample/Program.cs#L40

Jobs are enqueued but not executed. There are nothing extraordinary in logs. image image image

UPD: The reason is that updating options on the Client instance has no effect, while it is actively used.

As a possible workaround Init API can be changed to use CosmosClientBuilder instead of CosmosClient, as in this simple implementation

BeardVis commented 2 years ago

This problem is also relevant to me. Also, I hope for the possibility of adding CosmosDb using ConnectionString

lzhgus commented 1 year ago

For me, data got saved in Cosmos Db, but Jobs never being executed. I am using MassTransit with ServiceBus. Did anyone encounter the same issue?

maximilianbrandl commented 1 year ago

Has this issue already been solved? I've got the same problem and this makes the extension unusable for me..

klemmchr commented 10 months ago

Having the same issue. This library is not usable until this is fixed.

aligunel commented 8 months ago

Use this overload to run the jobs. UseAzureCosmosDbStorage(url, secretKey, database, collection, cosmoClientOptions); With CosmosClient , it will enqueue the job but will not run.