fix: catch and handle errors when dequeuing torrent
This commit is contained in:
parent
995fb1c6cf
commit
a4f20fd3a4
1 changed files with 9 additions and 1 deletions
|
|
@ -333,7 +333,15 @@ public class TorrentRunner(ILogger<TorrentRunner> logger, Torrents torrents, Dow
|
||||||
|
|
||||||
foreach (var torrent in torrentsToAddToProvider.Take(dequeueCount))
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue