swap out the scheduler #2750

pull/2922/head
Jamie Rees 6 years ago
parent 52d9a7a586
commit c3c0228b45

@ -32,7 +32,7 @@ namespace Ombi.Schedule.Tests
[Test]
public async Task DoesNotRun_WhenDisabled()
{
await Job.Start();
await Job.Execute(null);
Repo.Verify(x => x.GetAll(),Times.Never);
}
@ -50,7 +50,7 @@ namespace Ombi.Schedule.Tests
Settings.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new IssueSettings { DeleteIssues = true, DaysAfterResolvedToDelete = 5 });
Repo.Setup(x => x.GetAll()).Returns(new EnumerableQuery<Issues>(issues));
await Job.Start();
await Job.Execute(null);
Assert.That(issues.First().Status, Is.EqualTo(IssueStatus.Deleted));
Repo.Verify(x => x.SaveChangesAsync(), Times.Once);
@ -75,7 +75,7 @@ namespace Ombi.Schedule.Tests
Settings.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new IssueSettings { DeleteIssues = true, DaysAfterResolvedToDelete = 5 });
Repo.Setup(x => x.GetAll()).Returns(new EnumerableQuery<Issues>(issues));
await Job.Start();
await Job.Execute(null);
Assert.That(issues[0].Status, Is.Not.EqualTo(IssueStatus.Deleted));
Assert.That(issues[1].Status, Is.EqualTo(IssueStatus.Deleted));

@ -0,0 +1,36 @@
using Moq;
using NUnit.Framework;
using Quartz;
using System.Threading;
using System.Threading.Tasks;
namespace Ombi.Schedule.Tests
{
[TestFixture]
public class OmbiQuartzTests
{
[Test]
[Ignore("Cannot get this to work")]
public async Task Test()
{
var scheduleMock = new Mock<IScheduler>();
scheduleMock.Setup(x => x.TriggerJob(It.IsAny<JobKey>(),
It.IsAny<CancellationToken>()));
var sut = new QuartzMock(scheduleMock);
await QuartzMock.TriggerJob("ABC");
scheduleMock.Verify(x => x.TriggerJob(It.Is<JobKey>(j => j.Name == "ABC"),
default(CancellationToken)), Times.Once);
}
}
public class QuartzMock : OmbiQuartz
{
public QuartzMock(Mock<IScheduler> mock)
{
_instance = this;
_scheduler = mock.Object;
}
}
}

@ -46,7 +46,7 @@ namespace Ombi.Schedule.Tests
_movie.Setup(x => x.GetAll()).Returns(new List<MovieRequests> { request }.AsQueryable());
_repo.Setup(x => x.Get("test")).ReturnsAsync(new PlexServerContent());
await Checker.Start();
await Checker.Execute(null);
_movie.Verify(x => x.Save(), Times.Once);
@ -62,8 +62,8 @@ namespace Ombi.Schedule.Tests
};
_movie.Setup(x => x.GetAll()).Returns(new List<MovieRequests> { request }.AsQueryable());
await Checker.Start();
await Checker.Execute(null);
Assert.False(request.Available);
}
@ -107,7 +107,7 @@ namespace Ombi.Schedule.Tests
}.AsQueryable);
_repo.Setup(x => x.Include(It.IsAny<IQueryable<PlexEpisode>>(),It.IsAny<Expression<Func<PlexEpisode, PlexServerContent>>>()));
await Checker.Start();
await Checker.Execute(null);
_tv.Verify(x => x.Save(), Times.Once);

@ -21,22 +21,18 @@ namespace Ombi.Schedule.Jobs.Emby
public class EmbyContentSync : IEmbyContentSync
{
public EmbyContentSync(ISettingsService<EmbySettings> settings, IEmbyApi api, ILogger<EmbyContentSync> logger,
IEmbyContentRepository repo, IEmbyEpisodeSync epSync, IRefreshMetadata metadata)
IEmbyContentRepository repo)
{
_logger = logger;
_settings = settings;
_api = api;
_repo = repo;
_episodeSync = epSync;
_metadata = metadata;
}
private readonly ILogger<EmbyContentSync> _logger;
private readonly ISettingsService<EmbySettings> _settings;
private readonly IEmbyApi _api;
private readonly IEmbyContentRepository _repo;
private readonly IEmbyEpisodeSync _episodeSync;
private readonly IRefreshMetadata _metadata;
public async Task Execute(IJobExecutionContext job)
@ -58,6 +54,10 @@ namespace Ombi.Schedule.Jobs.Emby
}
// Episodes
await OmbiQuartz.TriggerJob(nameof(IEmbyEpisodeSync));
await OmbiQuartz.TriggerJob(nameof(IRefreshMetadata));
//BackgroundJob.Enqueue(() => _episodeSync.Start());
//BackgroundJob.Enqueue(() => _metadata.Start());
}

@ -42,21 +42,18 @@ namespace Ombi.Schedule.Jobs.Emby
{
public class EmbyEpisodeSync : IEmbyEpisodeSync
{
public EmbyEpisodeSync(ISettingsService<EmbySettings> s, IEmbyApi api, ILogger<EmbyEpisodeSync> l, IEmbyContentRepository repo,
IEmbyAvaliabilityChecker checker)
public EmbyEpisodeSync(ISettingsService<EmbySettings> s, IEmbyApi api, ILogger<EmbyEpisodeSync> l, IEmbyContentRepository repo)
{
_api = api;
_logger = l;
_settings = s;
_repo = repo;
_avaliabilityChecker = checker;
}
private readonly ISettingsService<EmbySettings> _settings;
private readonly IEmbyApi _api;
private readonly ILogger<EmbyEpisodeSync> _logger;
private readonly IEmbyContentRepository _repo;
private readonly IEmbyAvaliabilityChecker _avaliabilityChecker;
public async Task Execute(IJobExecutionContext job)
@ -68,7 +65,8 @@ namespace Ombi.Schedule.Jobs.Emby
await CacheEpisodes(server);
}
//BackgroundJob.Enqueue(() => _avaliabilityChecker.Start());
await OmbiQuartz.TriggerJob(nameof(IEmbyAvaliabilityChecker));
}
private async Task CacheEpisodes(EmbyServers server)
@ -143,7 +141,6 @@ namespace Ombi.Schedule.Jobs.Emby
{
_settings?.Dispose();
_repo?.Dispose();
_avaliabilityChecker?.Dispose();
}
_disposed = true;
}

@ -16,13 +16,12 @@ namespace Ombi.Schedule.Jobs.Ombi
public class MediaDatabaseRefresh : IMediaDatabaseRefresh
{
public MediaDatabaseRefresh(ISettingsService<PlexSettings> s, ILogger<MediaDatabaseRefresh> log,
IPlexContentRepository plexRepo, IEmbyContentRepository embyRepo, IEmbyContentSync embySync)
IPlexContentRepository plexRepo, IEmbyContentRepository embyRepo)
{
_settings = s;
_log = log;
_plexRepo = plexRepo;
_embyRepo = embyRepo;
_embyContentSync = embySync;
_settings.ClearCache();
}
@ -30,7 +29,6 @@ namespace Ombi.Schedule.Jobs.Ombi
private readonly ILogger _log;
private readonly IPlexContentRepository _plexRepo;
private readonly IEmbyContentRepository _embyRepo;
private readonly IEmbyContentSync _embyContentSync;
public async Task Execute(IJobExecutionContext job)
{
@ -61,7 +59,7 @@ namespace Ombi.Schedule.Jobs.Ombi
await _embyRepo.ExecuteSql(episodeSQL);
await _embyRepo.ExecuteSql(mainSql);
//BackgroundJob.Enqueue(() => _embyContentSync.Start()); // TODO
await OmbiQuartz.TriggerJob(nameof(IEmbyContentSync));
}
catch (Exception e)
{

@ -23,8 +23,7 @@ namespace Ombi.Schedule.Jobs.Ombi
{
public RefreshMetadata(IPlexContentRepository plexRepo, IEmbyContentRepository embyRepo,
ILogger<RefreshMetadata> log, ITvMazeApi tvApi, ISettingsService<PlexSettings> plexSettings,
IMovieDbApi movieApi, ISettingsService<EmbySettings> embySettings, IPlexAvailabilityChecker plexAvailability, IEmbyAvaliabilityChecker embyAvaliability,
IEmbyApi embyApi)
IMovieDbApi movieApi, ISettingsService<EmbySettings> embySettings, IEmbyApi embyApi)
{
_plexRepo = plexRepo;
_embyRepo = embyRepo;
@ -33,15 +32,11 @@ namespace Ombi.Schedule.Jobs.Ombi
_tvApi = tvApi;
_plexSettings = plexSettings;
_embySettings = embySettings;
_plexAvailabilityChecker = plexAvailability;
_embyAvaliabilityChecker = embyAvaliability;
_embyApi = embyApi;
}
private readonly IPlexContentRepository _plexRepo;
private readonly IEmbyContentRepository _embyRepo;
private readonly IPlexAvailabilityChecker _plexAvailabilityChecker;
private readonly IEmbyAvaliabilityChecker _embyAvaliabilityChecker;
private readonly ILogger _log;
private readonly IMovieDbApi _movieApi;
private readonly ITvMazeApi _tvApi;
@ -94,12 +89,12 @@ namespace Ombi.Schedule.Jobs.Ombi
{
if (plexSettings.Enable)
{
//BackgroundJob.Enqueue(() => _plexAvailabilityChecker.Start()); // TODO
await OmbiQuartz.TriggerJob(nameof(IPlexAvailabilityChecker));
}
if (embySettings.Enable)
{
//BackgroundJob.Enqueue(() => _embyAvaliabilityChecker.Start()); // TODO
await OmbiQuartz.TriggerJob(nameof(IEmbyAvaliabilityChecker));
}
}

@ -49,7 +49,7 @@ namespace Ombi.Schedule.Jobs.Plex
public class PlexContentSync : IPlexContentSync
{
public PlexContentSync(ISettingsService<PlexSettings> plex, IPlexApi plexApi, ILogger<PlexContentSync> logger, IPlexContentRepository repo,
IPlexEpisodeSync epsiodeSync, IRefreshMetadata metadataRefresh, IPlexAvailabilityChecker checker)
IPlexEpisodeSync epsiodeSync, IRefreshMetadata metadataRefresh)
{
Plex = plex;
PlexApi = plexApi;
@ -57,7 +57,6 @@ namespace Ombi.Schedule.Jobs.Plex
Repo = repo;
EpisodeSync = epsiodeSync;
Metadata = metadataRefresh;
Checker = checker;
Plex.ClearCache();
}
@ -67,7 +66,6 @@ namespace Ombi.Schedule.Jobs.Plex
private IPlexContentRepository Repo { get; }
private IPlexEpisodeSync EpisodeSync { get; }
private IRefreshMetadata Metadata { get; }
private IPlexAvailabilityChecker Checker { get; }
public async Task Execute(IJobExecutionContext context)
{
@ -105,7 +103,8 @@ namespace Ombi.Schedule.Jobs.Plex
if (!recentlyAddedSearch)
{
Logger.LogInformation("Starting EP Cacher");
//BackgroundJob.Enqueue(() => EpisodeSync.Start()); //TODO
await OmbiQuartz.TriggerJob(nameof(IPlexEpisodeSync));
}
if ((processedContent?.HasProcessedContent ?? false) && recentlyAddedSearch)
@ -116,7 +115,8 @@ namespace Ombi.Schedule.Jobs.Plex
if ((processedContent?.HasProcessedEpisodes ?? false) && recentlyAddedSearch)
{
//BackgroundJob.Enqueue(() => Checker.Start()); // TODO
await OmbiQuartz.TriggerJob(nameof(IPlexAvailabilityChecker));
}
}

@ -20,13 +20,12 @@ namespace Ombi.Schedule.Jobs.Plex
public class PlexEpisodeSync : IPlexEpisodeSync
{
public PlexEpisodeSync(ISettingsService<PlexSettings> s, ILogger<PlexEpisodeSync> log, IPlexApi plexApi,
IPlexContentRepository repo, IPlexAvailabilityChecker a)
IPlexContentRepository repo)
{
_settings = s;
_log = log;
_api = plexApi;
_repo = repo;
_availabilityChecker = a;
_settings.ClearCache();
}
@ -34,7 +33,6 @@ namespace Ombi.Schedule.Jobs.Plex
private readonly ILogger<PlexEpisodeSync> _log;
private readonly IPlexApi _api;
private readonly IPlexContentRepository _repo;
private readonly IPlexAvailabilityChecker _availabilityChecker;
public async Task Execute(IJobExecutionContext job)
{
@ -57,6 +55,8 @@ namespace Ombi.Schedule.Jobs.Plex
_log.LogError(LoggingEvents.Cacher, e, "Caching Episodes Failed");
}
await OmbiQuartz.TriggerJob(nameof(IPlexAvailabilityChecker));
//BackgroundJob.Enqueue(() => _availabilityChecker.Start()); // TODO
}

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Quartz;
using Quartz.Impl;
using Quartz.Spi;
@ -7,19 +8,19 @@ namespace Ombi.Schedule
{
public class OmbiQuartz
{
private IScheduler _scheduler;
protected IScheduler _scheduler { get; set; }
public static IScheduler Scheduler => Instance._scheduler;
// Singleton
private static OmbiQuartz _instance;
protected static OmbiQuartz _instance;
/// <summary>
/// Singleton
/// </summary>
public static OmbiQuartz Instance => _instance ?? (_instance = new OmbiQuartz());
private OmbiQuartz()
protected OmbiQuartz()
{
Init();
}
@ -35,7 +36,7 @@ namespace Ombi.Schedule
return Scheduler;
}
public async void AddJob<T>(string name, string group, string cronExpression, Dictionary<string, string> jobData = null)
public async Task AddJob<T>(string name, string group, string cronExpression, Dictionary<string, string> jobData = null)
where T : IJob
{
var jobBuilder = JobBuilder.Create<T>()
@ -52,16 +53,18 @@ namespace Ombi.Schedule
ITrigger jobTrigger = TriggerBuilder.Create()
.WithIdentity(name + "Trigger", group)
.StartNow()
.WithCronSchedule(cronExpression)
.Build();
await Scheduler.ScheduleJob(job, jobTrigger);
}
public static async Task TriggerJob(string jobName)
{
await Scheduler.TriggerJob(new JobKey(jobName));
}
public static async void Start()
public static async Task Start()
{
await Scheduler.Start();
}

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Ombi.Core.Settings;
using Ombi.Schedule.Jobs;
@ -38,7 +39,7 @@ namespace Ombi.Schedule
// .Build();
//}
public static void UseQuartz(this IApplicationBuilder app)
public static async Task UseQuartz(this IApplicationBuilder app)
{
// Job Factory through IOC container
var jobFactory = (IJobFactory)app.ApplicationServices.GetService(typeof(IJobFactory));
@ -48,47 +49,47 @@ namespace Ombi.Schedule
OmbiQuartz.Instance.UseJobFactory(jobFactory);
// Run Quartz
OmbiQuartz.Start();
await OmbiQuartz.Start();
// Run configuration
AddPlex(s);
AddEmby(s);
AddDvrApps(s);
AddSystem(s);
await AddPlex(s);
await AddEmby(s);
await AddDvrApps(s);
await AddSystem(s);
}
private static void AddSystem(JobSettings s)
private static async Task AddSystem(JobSettings s)
{
OmbiQuartz.Instance.AddJob<IRefreshMetadata>(nameof(IRefreshMetadata), "System", JobSettingsHelper.RefreshMetadata(s));
OmbiQuartz.Instance.AddJob<IIssuesPurge>(nameof(IIssuesPurge), "System", JobSettingsHelper.IssuePurge(s));
await OmbiQuartz.Instance.AddJob<IRefreshMetadata>(nameof(IRefreshMetadata), "System", JobSettingsHelper.RefreshMetadata(s));
await OmbiQuartz.Instance.AddJob<IIssuesPurge>(nameof(IIssuesPurge), "System", JobSettingsHelper.IssuePurge(s));
//OmbiQuartz.Instance.AddJob<IOmbiAutomaticUpdater>(nameof(IOmbiAutomaticUpdater), "System", JobSettingsHelper.Updater(s));
OmbiQuartz.Instance.AddJob<INewsletterJob>(nameof(INewsletterJob), "System", JobSettingsHelper.Newsletter(s));
OmbiQuartz.Instance.AddJob<IResendFailedRequests>(nameof(IResendFailedRequests), "System", JobSettingsHelper.ResendFailedRequests(s));
OmbiQuartz.Instance.AddJob<IMediaDatabaseRefresh>(nameof(IMediaDatabaseRefresh), "System", JobSettingsHelper.MediaDatabaseRefresh(s));
await OmbiQuartz.Instance.AddJob<INewsletterJob>(nameof(INewsletterJob), "System", JobSettingsHelper.Newsletter(s));
await OmbiQuartz.Instance.AddJob<IResendFailedRequests>(nameof(IResendFailedRequests), "System", JobSettingsHelper.ResendFailedRequests(s));
await OmbiQuartz.Instance.AddJob<IMediaDatabaseRefresh>(nameof(IMediaDatabaseRefresh), "System", JobSettingsHelper.MediaDatabaseRefresh(s));
}
private static void AddDvrApps(JobSettings s)
private static async Task AddDvrApps(JobSettings s)
{
OmbiQuartz.Instance.AddJob<ISonarrSync>(nameof(ISonarrSync), "DVR", JobSettingsHelper.Sonarr(s));
OmbiQuartz.Instance.AddJob<IRadarrSync>(nameof(IRadarrSync), "DVR", JobSettingsHelper.Radarr(s));
OmbiQuartz.Instance.AddJob<ICouchPotatoSync>(nameof(ICouchPotatoSync), "DVR", JobSettingsHelper.CouchPotato(s));
OmbiQuartz.Instance.AddJob<ISickRageSync>(nameof(ISickRageSync), "DVR", JobSettingsHelper.SickRageSync(s));
OmbiQuartz.Instance.AddJob<ILidarrArtistSync>(nameof(ILidarrArtistSync), "DVR", JobSettingsHelper.LidarrArtistSync(s));
await OmbiQuartz.Instance.AddJob<ISonarrSync>(nameof(ISonarrSync), "DVR", JobSettingsHelper.Sonarr(s));
await OmbiQuartz.Instance.AddJob<IRadarrSync>(nameof(IRadarrSync), "DVR", JobSettingsHelper.Radarr(s));
await OmbiQuartz.Instance.AddJob<ICouchPotatoSync>(nameof(ICouchPotatoSync), "DVR", JobSettingsHelper.CouchPotato(s));
await OmbiQuartz.Instance.AddJob<ISickRageSync>(nameof(ISickRageSync), "DVR", JobSettingsHelper.SickRageSync(s));
await OmbiQuartz.Instance.AddJob<ILidarrArtistSync>(nameof(ILidarrArtistSync), "DVR", JobSettingsHelper.LidarrArtistSync(s));
}
private static void AddPlex(JobSettings s)
private static async Task AddPlex(JobSettings s)
{
OmbiQuartz.Instance.AddJob<IPlexContentSync>(nameof(IPlexContentSync), "Plex", JobSettingsHelper.PlexContent(s), new Dictionary<string, string> { { "recentlyAddedSearch", "false" } });
OmbiQuartz.Instance.AddJob<IPlexContentSync>(nameof(IPlexContentSync) + "RecentlyAdded", "Plex", JobSettingsHelper.PlexContent(s), new Dictionary<string, string> { { "recentlyAddedSearch", "true" } });
OmbiQuartz.Instance.AddJob<IPlexRecentlyAddedSync>(nameof(IPlexRecentlyAddedSync), "Plex", JobSettingsHelper.PlexRecentlyAdded(s));
OmbiQuartz.Instance.AddJob<IPlexUserImporter>(nameof(IPlexUserImporter), "Plex", JobSettingsHelper.UserImporter(s));
await OmbiQuartz.Instance.AddJob<IPlexContentSync>(nameof(IPlexContentSync), "Plex", JobSettingsHelper.PlexContent(s), new Dictionary<string, string> { { "recentlyAddedSearch", "false" } });
await OmbiQuartz.Instance.AddJob<IPlexContentSync>(nameof(IPlexContentSync) + "RecentlyAdded", "Plex", JobSettingsHelper.PlexContent(s), new Dictionary<string, string> { { "recentlyAddedSearch", "true" } });
await OmbiQuartz.Instance.AddJob<IPlexRecentlyAddedSync>(nameof(IPlexRecentlyAddedSync), "Plex", JobSettingsHelper.PlexRecentlyAdded(s));
await OmbiQuartz.Instance.AddJob<IPlexUserImporter>(nameof(IPlexUserImporter), "Plex", JobSettingsHelper.UserImporter(s));
}
private static void AddEmby(JobSettings s)
private static async Task AddEmby(JobSettings s)
{
OmbiQuartz.Instance.AddJob<IEmbyContentSync>(nameof(IEmbyContentSync), "Emby", JobSettingsHelper.EmbyContent(s));
OmbiQuartz.Instance.AddJob<IEmbyUserImporter>(nameof(IEmbyUserImporter), "Emby", JobSettingsHelper.UserImporter(s));
await OmbiQuartz.Instance.AddJob<IEmbyContentSync>(nameof(IEmbyContentSync), "Emby", JobSettingsHelper.EmbyContent(s));
await OmbiQuartz.Instance.AddJob<IEmbyUserImporter>(nameof(IEmbyUserImporter), "Emby", JobSettingsHelper.UserImporter(s));
}
}
}

@ -48,9 +48,10 @@ namespace Ombi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost("update")]
public bool ForceUpdate()
public async Task<bool> ForceUpdate()
{
//BackgroundJob.Enqueue(() => _updater.Update(null));
await OmbiQuartz.TriggerJob(nameof(IOmbiAutomaticUpdater));
return true;
}
@ -97,9 +98,9 @@ namespace Ombi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost("plexuserimporter")]
public bool PlexUserImporter()
public async Task<bool> PlexUserImporter()
{
//BackgroundJob.Enqueue(() => _plexUserImporter.Start()); //TODO
await OmbiQuartz.TriggerJob(nameof(IPlexUserImporter));
return true;
}
@ -108,9 +109,9 @@ namespace Ombi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost("embyuserimporter")]
public bool EmbyUserImporter()
public async Task<bool> EmbyUserImporter()
{
//BackgroundJob.Enqueue(() => _embyUserImporter.Start()); // TODO
await OmbiQuartz.TriggerJob(nameof(IEmbyUserImporter));
return true;
}
@ -141,9 +142,9 @@ namespace Ombi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost("embycontentcacher")]
public bool StartEmbyContentCacher()
public async Task<bool> StartEmbyContentCacher()
{
//BackgroundJob.Enqueue(() => _embyContentSync.Start()); // TODO
await OmbiQuartz.TriggerJob(nameof(IEmbyContentSync));
return true;
}
@ -152,9 +153,9 @@ namespace Ombi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost("newsletter")]
public bool StartNewsletter()
public async Task<bool> StartNewsletter()
{
//BackgroundJob.Enqueue(() => _newsletterJob.Start()); // TODO
await OmbiQuartz.TriggerJob(nameof(INewsletterJob));
return true;
}
}

@ -27,6 +27,7 @@ using Ombi.Store.Entities;
using Ombi.Store.Repository;
using Ombi.Api.Github;
using Ombi.Core.Engine;
using Ombi.Schedule;
namespace Ombi.Controllers
{
@ -44,7 +45,6 @@ namespace Ombi.Controllers
IMapper mapper,
INotificationTemplatesRepository templateRepo,
IEmbyApi embyApi,
IRadarrSync radarrSync,
ICacheService memCache,
IGithubApi githubApi,
IRecentlyAddedEngine engine)
@ -53,7 +53,6 @@ namespace Ombi.Controllers
Mapper = mapper;
TemplateRepository = templateRepo;
_embyApi = embyApi;
_radarrSync = radarrSync;
_cache = memCache;
_githubApi = githubApi;
_recentlyAdded = engine;
@ -63,7 +62,6 @@ namespace Ombi.Controllers
private IMapper Mapper { get; }
private INotificationTemplatesRepository TemplateRepository { get; }
private readonly IEmbyApi _embyApi;
private readonly IRadarrSync _radarrSync;
private readonly ICacheService _cache;
private readonly IGithubApi _githubApi;
private readonly IRecentlyAddedEngine _recentlyAdded;
@ -387,7 +385,8 @@ namespace Ombi.Controllers
{
_cache.Remove(CacheKeys.RadarrRootProfiles);
_cache.Remove(CacheKeys.RadarrQualityProfiles);
//BackgroundJob.Enqueue(() => _radarrSync.CacheContent()); // TODO
await OmbiQuartz.TriggerJob(nameof(IRadarrSync));
}
return result;
}

@ -123,7 +123,7 @@ namespace Ombi
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseQuartz();
app.UseQuartz().GetAwaiter().GetResult();
var ctx = serviceProvider.GetService<IOmbiContext>();
loggerFactory.AddSerilog();

Loading…
Cancel
Save