mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Removed the DI part of the service. TinyIOC doesn't want to work with FluentScheduler.
This commit is contained in:
parent
7636409790
commit
5363cf6891
9 changed files with 29 additions and 204 deletions
|
@ -32,18 +32,27 @@ using System.Web.Hosting;
|
|||
|
||||
using FluentScheduler;
|
||||
|
||||
using Mono.Data.Sqlite;
|
||||
|
||||
using NLog;
|
||||
|
||||
using PlexRequests.Api.Models;
|
||||
using PlexRequests.Core;
|
||||
using PlexRequests.Core.SettingModels;
|
||||
using PlexRequests.Helpers;
|
||||
using PlexRequests.Services.Interfaces;
|
||||
using PlexRequests.Store;
|
||||
using PlexRequests.Store.Repository;
|
||||
|
||||
namespace PlexRequests.Services
|
||||
{
|
||||
public class AvailabilityUpdateService : ITask, IRegisteredObject
|
||||
public class AvailabilityUpdateService : ITask, IRegisteredObject, IAvailabilityUpdateService
|
||||
{
|
||||
public AvailabilityUpdateService(IConfigurationReader reader, IAvailabilityChecker checker)
|
||||
public AvailabilityUpdateService()
|
||||
{
|
||||
ConfigurationReader = reader;
|
||||
Checker = checker;
|
||||
ConfigurationReader = new ConfigurationReader();
|
||||
var repo = new JsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider());
|
||||
Checker = new PlexAvailabilityChecker(new SettingsServiceV2<PlexSettings>(repo), new SettingsServiceV2<AuthenticationSettings>(repo), new RequestService(new GenericRepository<RequestedModel>(new DbConfiguration(new SqliteFactory()))) );
|
||||
HostingEnvironment.RegisterObject(this);
|
||||
}
|
||||
|
||||
|
@ -57,7 +66,7 @@ namespace PlexRequests.Services
|
|||
{
|
||||
UpdateSubscription?.Dispose();
|
||||
|
||||
UpdateSubscription = Observable.Interval(c.Intervals.Measurement).Subscribe(Checker.CheckAndUpdateAll);
|
||||
UpdateSubscription = Observable.Interval(c.Intervals.Notification).Subscribe(Checker.CheckAndUpdateAll);
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
|
@ -70,4 +79,9 @@ namespace PlexRequests.Services
|
|||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public interface IAvailabilityUpdateService
|
||||
{
|
||||
void Start(Configuration c);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue