mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-31 12:14:44 -04:00
24 lines
752 B
C#
24 lines
752 B
C#
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(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);
|
|
//RecurringJob.AddOrUpdate(() => scanService.ScanLibraries(), Cron.Daily);
|
|
}
|
|
|
|
|
|
}
|
|
} |