Add the Issue Reporting functionality (#1811)

* Added issuesreporting and the ability to add categories to the UI
* Added lazy loading!
This commit is contained in:
Jamie 2017-12-28 21:51:33 +00:00 committed by GitHub
parent 438f56eceb
commit 246f1c07cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 2905 additions and 526 deletions

View file

@ -16,7 +16,7 @@ namespace Ombi.Api
{
public class Api : IApi
{
public Api(ILogger<Api> log, ISettingsService<OmbiSettings> s, IMemoryCache cache)
public Api(ILogger<Api> log, ISettingsService<OmbiSettings> s, ICacheService cache)
{
Logger = log;
_settings = s;
@ -25,15 +25,11 @@ namespace Ombi.Api
private ILogger<Api> Logger { get; }
private readonly ISettingsService<OmbiSettings> _settings;
private readonly IMemoryCache _cache;
private readonly ICacheService _cache;
private async Task<HttpMessageHandler> GetHandler()
{
var settings = await _cache.GetOrCreateAsync(CacheKeys.OmbiSettings, async entry =>
{
entry.AbsoluteExpiration = DateTimeOffset.Now.AddHours(1);
return await _settings.GetSettingsAsync();
});
var settings = await _cache.GetOrAdd(CacheKeys.OmbiSettings, async () => await _settings.GetSettingsAsync(), DateTime.Now.AddHours(1));
if (settings.IgnoreCertificateErrors)
{
return new HttpClientHandler