diff --git a/src/Core/Services/LiteDbStorageService.cs b/src/Core/Services/LiteDbStorageService.cs index 2278636b6..d0b836673 100644 --- a/src/Core/Services/LiteDbStorageService.cs +++ b/src/Core/Services/LiteDbStorageService.cs @@ -32,21 +32,18 @@ namespace Bit.Core.Services { return _initTask; } - Task doTask() + _initTask = Task.Run(() => { - try { var db = new LiteDatabase($"Filename={_dbPath};"); _collection = db.GetCollection("json_items"); - return Task.FromResult(0); } finally { _initTask = null; } - }; - _initTask = doTask(); + }); return _initTask; }