Generic try catch to fix #350

pull/383/head
tidusjar 8 years ago
parent af9953be6c
commit 8b52ba2967

@ -24,6 +24,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Linq;
using NLog;
@ -86,14 +88,18 @@ namespace PlexRequests.Services.Jobs
// we do not want to set here...
public int[] QueuedIds()
{
Log.Error("This is not an error, starting to get the CP Cached Id's");
var movies = Cache.Get<CouchPotatoMovies>(CacheKeys.CouchPotatoQueued);
Log.Error("Cached result:");
Log.Error(movies.DumpJson());
try
{
var movies = Cache.Get<CouchPotatoMovies>(CacheKeys.CouchPotatoQueued);
var items = movies?.movies?.Select(x => x.info?.tmdb_id).Cast<int>().ToArray();
return items ?? new int[] { };
var items = movies?.movies?.Select(x => x.info?.tmdb_id).Cast<int>().ToArray();
return items ?? new int[] { };
}
catch (Exception e)
{
Log.Error(e);
return new int[] {};
}
}
public void Execute(IJobExecutionContext context)

Loading…
Cancel
Save