fix: catch and handle errors when dequeuing torrent

This commit is contained in:
Cucumberrbob 2025-04-20 12:00:21 +01:00
parent 995fb1c6cf
commit a4f20fd3a4
No known key found for this signature in database
GPG key ID: 2B935C47401C3614

View file

@ -333,7 +333,15 @@ public class TorrentRunner(ILogger<TorrentRunner> logger, Torrents torrents, Dow
foreach (var torrent in torrentsToAddToProvider.Take(dequeueCount))
{
await torrents.DequeueFromDebridQueue(torrent);
try
{
await torrents.DequeueFromDebridQueue(torrent);
}
catch (Exception ex)
{
await torrents.UpdateComplete(torrent.TorrentId, $"Could not add to provider: {ex.Message}", DateTimeOffset.Now, true);
logger.LogWarning(ex, "Could not dequeue torrent {torrentId}", torrent.TorrentId);
}
}
}