fix(feedmerge): allow a single feed to break, and dont break the whole bridge (#3476)

This commit is contained in:
Dag 2023-07-05 05:41:01 +02:00 committed by GitHub
parent a21d496bc7
commit 82c22bd2b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 3 deletions

View File

@ -58,9 +58,21 @@ TEXT;
$feeds = array_filter($feeds);
foreach ($feeds as $feed) {
// Fetch all items from the feed
// todo: consider wrapping this in a try..catch to not let a single feed break the entire bridge?
$this->collectExpandableDatas($feed);
if (count($feeds) > 1) {
// Allow one or more feeds to fail
try {
$this->collectExpandableDatas($feed);
} catch (HttpException $e) {
$this->items[] = [
'title' => 'RSS-Bridge: ' . $e->getMessage(),
// Give current time so it sorts to the top
'timestamp' => time(),
];
continue;
}
} else {
$this->collectExpandableDatas($feed);
}
}
// Sort by timestamp descending