additional cacher error handling + don't bother checking the requests when we don't get data back from plex

This commit is contained in:
Drewster727 2016-04-21 09:00:06 -05:00
commit ba06e8630f
4 changed files with 60 additions and 24 deletions

View file

@ -62,10 +62,17 @@ namespace PlexRequests.Services.Jobs
if (settings.Enabled)
{
Log.Trace("Getting all shows from SickRage");
var shows = SrApi.GetShows(settings.ApiKey, settings.FullUri);
if (shows != null)
try
{
Cache.Set(CacheKeys.SickRageQueued, shows.Result, CacheKeys.TimeFrameMinutes.SchedulerCaching);
var shows = SrApi.GetShows(settings.ApiKey, settings.FullUri);
if (shows != null)
{
Cache.Set(CacheKeys.SickRageQueued, shows.Result, CacheKeys.TimeFrameMinutes.SchedulerCaching);
}
}
catch (System.Exception ex)
{
Log.Error(ex, "Failed caching queued items from SickRage");
}
}
}