mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-14 09:12:57 -07:00
increase the scheduler cache timeframe to avoid losing cache when the remote api endpoints go offline (due to a reboot or some other reason) -- if they're online, the cache will get refreshed every 10 minutes like normal
This commit is contained in:
parent
121465210d
commit
508baeec04
5 changed files with 18 additions and 6 deletions
|
@ -30,7 +30,7 @@ namespace PlexRequests.Core
|
||||||
{
|
{
|
||||||
public struct TimeFrameMinutes
|
public struct TimeFrameMinutes
|
||||||
{
|
{
|
||||||
public const int SchedulerCaching = 10;
|
public const int SchedulerCaching = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
public const string PlexLibaries = "PlexLibaries";
|
public const string PlexLibaries = "PlexLibaries";
|
||||||
|
|
|
@ -63,9 +63,12 @@ namespace PlexRequests.Services.Jobs
|
||||||
{
|
{
|
||||||
Log.Trace("Getting all movies from CouchPotato");
|
Log.Trace("Getting all movies from CouchPotato");
|
||||||
var movies = CpApi.GetMovies(settings.FullUri, settings.ApiKey, new[] { "active" });
|
var movies = CpApi.GetMovies(settings.FullUri, settings.ApiKey, new[] { "active" });
|
||||||
|
if (movies != null)
|
||||||
|
{
|
||||||
Cache.Set(CacheKeys.CouchPotatoQueued, movies, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
Cache.Set(CacheKeys.CouchPotatoQueued, movies, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// we do not want to set here...
|
// we do not want to set here...
|
||||||
public int[] QueuedIds()
|
public int[] QueuedIds()
|
||||||
|
|
|
@ -256,8 +256,11 @@ namespace PlexRequests.Services.Jobs
|
||||||
results = GetLibraries(authSettings, plexSettings);
|
results = GetLibraries(authSettings, plexSettings);
|
||||||
|
|
||||||
Log.Trace("Plex Lib Cache Set Call");
|
Log.Trace("Plex Lib Cache Set Call");
|
||||||
|
if (results != null)
|
||||||
|
{
|
||||||
Cache.Set(CacheKeys.PlexLibaries, results, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
Cache.Set(CacheKeys.PlexLibaries, results, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log.Trace("Plex Lib GetSet Call");
|
Log.Trace("Plex Lib GetSet Call");
|
||||||
|
|
|
@ -62,8 +62,11 @@ namespace PlexRequests.Services.Jobs
|
||||||
if (settings.Enabled)
|
if (settings.Enabled)
|
||||||
{
|
{
|
||||||
Log.Trace("Getting all shows from SickRage");
|
Log.Trace("Getting all shows from SickRage");
|
||||||
var movies = SrApi.GetShows(settings.ApiKey, settings.FullUri);
|
var shows = SrApi.GetShows(settings.ApiKey, settings.FullUri);
|
||||||
Cache.Set(CacheKeys.SickRageQueued, movies.Result, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
if (shows != null)
|
||||||
|
{
|
||||||
|
Cache.Set(CacheKeys.SickRageQueued, shows.Result, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,12 @@ namespace PlexRequests.Services.Jobs
|
||||||
{
|
{
|
||||||
Log.Trace("Getting all tv series from Sonarr");
|
Log.Trace("Getting all tv series from Sonarr");
|
||||||
var series = SonarrApi.GetSeries(settings.ApiKey, settings.FullUri);
|
var series = SonarrApi.GetSeries(settings.ApiKey, settings.FullUri);
|
||||||
|
if (series != null)
|
||||||
|
{
|
||||||
Cache.Set(CacheKeys.SonarrQueued, series, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
Cache.Set(CacheKeys.SonarrQueued, series, CacheKeys.TimeFrameMinutes.SchedulerCaching);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// we do not want to set here...
|
// we do not want to set here...
|
||||||
public int[] QueuedIds()
|
public int[] QueuedIds()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue