|
|
|
@ -46,7 +46,8 @@ public class LiteDbContext : ILiteDbContext
|
|
|
|
|
{ |
|
|
|
|
db = new LiteDatabaseAsync(":temp:"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Attempt to create connection, might be in use |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
@ -61,6 +62,7 @@ public class LiteDbContext : ILiteDbContext
|
|
|
|
|
{ |
|
|
|
|
logger.LogWarning("Database in use or not accessible ({Message}), using temporary database", e.Message); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Fallback to temporary database |
|
|
|
|
db ??= new LiteDatabaseAsync(":temp:"); |
|
|
|
@ -136,12 +138,15 @@ public class LiteDbContext : ILiteDbContext
|
|
|
|
|
return changed; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<GithubCacheEntry?> GetGithubCacheEntry(string cacheKey) |
|
|
|
|
public async Task<GithubCacheEntry?> GetGithubCacheEntry(string? cacheKey) |
|
|
|
|
{ |
|
|
|
|
if (string.IsNullOrEmpty(cacheKey)) return null; |
|
|
|
|
|
|
|
|
|
if (await GithubCache.FindByIdAsync(cacheKey).ConfigureAwait(false) is { } result) |
|
|
|
|
{ |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|