Cache cleanup implemented
This commit is contained in:
parent
f737f662df
commit
731e3a9c5e
11 changed files with 132 additions and 29 deletions
|
@ -1,15 +1,21 @@
|
|||
using API.Interfaces;
|
||||
using Hangfire;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace API.Services
|
||||
{
|
||||
public class TaskScheduler : ITaskScheduler
|
||||
{
|
||||
private readonly ILogger<TaskScheduler> _logger;
|
||||
private readonly BackgroundJobServer _client;
|
||||
|
||||
public TaskScheduler()
|
||||
public TaskScheduler(ICacheService cacheService, ILogger<TaskScheduler> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_client = new BackgroundJobServer();
|
||||
|
||||
_logger.LogInformation("Scheduling/Updating cache cleanup on a daily basis.");
|
||||
RecurringJob.AddOrUpdate(() => cacheService.Cleanup(), Cron.Daily);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue