codeyu / Hangfire.LiteDB

LiteDB storage for Hangfire.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LiteDB Version 5

TobiasBloch opened this issue · comments

Since LiteDB released version 5 with some breaking changes I can't use this anymore since I have several other project dependencies already using the new version.
So my question is if you could update the version to the newest LiteDB version

I think I'm in the same boat.

System.MissingMethodException: Method not found: 'LiteDB.LiteDatabase LiteDB.LiteRepository.get_Database()'.
   at Hangfire.LiteDB.HangfireDbContext..ctor(String connectionString, String prefix)
   at Hangfire.LiteDB.HangfireDbContext.Instance(String connectionString, String prefix)
   at Hangfire.LiteDB.LiteDbStorage..ctor(String connectionString, LiteDbStorageOptions storageOptions)
   at Hangfire.LiteDB.LiteDbStorageExtensions.UseLiteDbStorage(IGlobalConfiguration configuration)
   at App.Startup.ConfigureServices(IServiceCollection services)

I suspect the issue is at

Database = Repository.Database;

EDIT: I don't think that's the issue, LiteRepository still has a Database property.

I'll see if I can look into it next week.

Okay, a bit more work than just swapping to V5 and using the interfaces.

The way BsonExpressions seem to work is quite a bit different from V4 for things like Find(). For example, the DateTime.ToUniversalTime() in https://github.com/codeyu/Hangfire.LiteDB/blob/master/src/Hangfire.LiteDB/ExpirationManager.cs#L77-L82 don't seem to work properly with BsonExpressions.

I'm slowly working my way through the unit tests and patching things up as I go.

I'm hitting this same issue as well - and unfortunately my use-case is time-sensitive. Any chance of an ETA on this? Or might I be better for now (at least) to just roll back to the previous LiteDB version?
Thanks!

Edit: I've gone ahead and rolled back to LiteDB 4.x for now - had to work around the absence of the bulk operators - but wasn't a big deal and fortunately wasn't a scenario where perf was noticeably deteriorated - so all good for now :)

Just submitted #25
AppVeyor is failing tests, so likely missed something.

Is this issue fixed? I'm having same issue with this version....