mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
Generic try catch to fix #350
This commit is contained in:
parent
af9953be6c
commit
8b52ba2967
1 changed files with 13 additions and 7 deletions
|
@ -24,6 +24,8 @@
|
||||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
// ************************************************************************/
|
// ************************************************************************/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using NLog;
|
using NLog;
|
||||||
|
@ -86,15 +88,19 @@ namespace PlexRequests.Services.Jobs
|
||||||
// we do not want to set here...
|
// we do not want to set here...
|
||||||
public int[] QueuedIds()
|
public int[] QueuedIds()
|
||||||
{
|
{
|
||||||
Log.Error("This is not an error, starting to get the CP Cached Id's");
|
try
|
||||||
|
{
|
||||||
var movies = Cache.Get<CouchPotatoMovies>(CacheKeys.CouchPotatoQueued);
|
var movies = Cache.Get<CouchPotatoMovies>(CacheKeys.CouchPotatoQueued);
|
||||||
Log.Error("Cached result:");
|
|
||||||
Log.Error(movies.DumpJson());
|
|
||||||
|
|
||||||
var items = movies?.movies?.Select(x => x.info?.tmdb_id).Cast<int>().ToArray();
|
var items = movies?.movies?.Select(x => x.info?.tmdb_id).Cast<int>().ToArray();
|
||||||
return items ?? new int[] { };
|
return items ?? new int[] { };
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.Error(e);
|
||||||
|
return new int[] {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Execute(IJobExecutionContext context)
|
public void Execute(IJobExecutionContext context)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue