Cleanup on aisle DbCacheService
This commit is contained in:
@@ -6,6 +6,7 @@ namespace GrossesMitainesAPI.Services {
|
||||
public class DatabaseCacheService {
|
||||
private readonly IServiceScopeFactory _contextFactory; // https://entityframeworkcore.com/knowledge-base/51939451/how-to-use-a-database-context-in-a-singleton-service-
|
||||
private readonly ILogger<DatabaseCacheService> _logger;
|
||||
|
||||
private Product[] _cache = new Product[1];
|
||||
private bool _ok = false, _needUpd = true;
|
||||
private PeriodicTimer _timer = new PeriodicTimer(TimeSpan.FromSeconds(10));
|
||||
@@ -25,7 +26,6 @@ namespace GrossesMitainesAPI.Services {
|
||||
_needUpd = !_ok;
|
||||
}
|
||||
}
|
||||
|
||||
private bool UpdateCache() {
|
||||
try {
|
||||
Product[] prods;
|
||||
|
Reference in New Issue
Block a user