Skip to content

Commit d9f007c

Browse files
committed
Increased HTTP timeouts, added UA to rss fetch
1 parent a144c25 commit d9f007c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/Rss/FeedPostFetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(
1818
*/
1919
public function fetchForFeed(Feed $feed): array
2020
{
21-
$feedResponse = Http::timeout(5)->get($feed->url);
21+
$feedResponse = Http::timeout(10)->withUserAgent('rss/4.5.6')->get($feed->url);
2222
if (!$feedResponse->successful()) {
2323
return [];
2424
}

app/Rss/PostThumbnailFetcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function fetchAndStoreForPost(Post $post): bool
3737
*/
3838
protected function downloadImageFromUrl(string $url): ?array
3939
{
40-
$imageResponse = Http::timeout(5)->withUserAgent('rss/4.5.6')->get($url);
40+
$imageResponse = Http::timeout(10)->withUserAgent('rss/4.5.6')->get($url);
4141
if (!$imageResponse->successful()) {
4242
return null;
4343
}
@@ -61,7 +61,7 @@ protected function downloadImageFromUrl(string $url): ?array
6161

6262
protected function getThumbLinkFromUrl(string $url): string
6363
{
64-
$pageResponse = Http::timeout(5)->withUserAgent('rss/4.5.6')->get($url);
64+
$pageResponse = Http::timeout(10)->withUserAgent('rss/4.5.6')->get($url);
6565
if (!$pageResponse->successful()) {
6666
return '';
6767
}

0 commit comments

Comments
 (0)