New: Cache searches for 5 days

This commit is contained in:
ta264
2021-03-30 21:26:43 +01:00
parent 996841db45
commit d078dacaab
4 changed files with 20 additions and 7 deletions
@@ -3,7 +3,9 @@ using System.Collections.Generic;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Core.Books;
using NzbDrone.Core.Http;
using NzbDrone.Core.MetadataSource.Goodreads;
using NzbDrone.Core.Profiles.Metadata;
using NzbDrone.Core.Test.Framework;
@@ -19,6 +21,11 @@ namespace NzbDrone.Core.Test.MetadataSource.Goodreads
{
UseRealHttp();
var httpClient = Mocker.Resolve<IHttpClient>();
Mocker.GetMock<ICachedHttpResponseService>()
.Setup(x => x.Get<List<SearchJsonResource>>(It.IsAny<HttpRequest>(), It.IsAny<bool>(), It.IsAny<TimeSpan>()))
.Returns((HttpRequest request, bool useCache, TimeSpan ttl) => httpClient.Get<List<SearchJsonResource>>(request));
var metadataProfile = new MetadataProfile();
Mocker.GetMock<IMetadataProfileService>()