From 29b35d014db65938a418f2f1496190a2a2f07e78 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sun, 3 Dec 2023 16:31:10 +0800 Subject: [PATCH] curl timeout --- src/app/Core/PlaylistProcessor.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/Core/PlaylistProcessor.php b/src/app/Core/PlaylistProcessor.php index 1ddac61..c4ae2d1 100644 --- a/src/app/Core/PlaylistProcessor.php +++ b/src/app/Core/PlaylistProcessor.php @@ -30,11 +30,10 @@ final class PlaylistProcessor $filepath = config_path('playlists.ini'); $this->updated_at = date('d.m.Y h:i', filemtime($filepath)); $this->playlists = collect(parse_ini_file($filepath, true)) - ->transform(function ($playlist, $id) { - return empty($playlist['redirect']) - ? new Playlist((string)$id, $playlist) - : new RedirectedPlaylist((string)$id, $playlist['redirect']); - }); + ->transform(static fn ($playlist, $id) => empty($playlist['redirect']) + ? new Playlist((string)$id, $playlist) + : new RedirectedPlaylist((string)$id, $playlist['redirect']) + ); } /** @@ -97,7 +96,7 @@ final class PlaylistProcessor curl_setopt_array($curl, [ CURLOPT_URL => $this->playlist($id)->pls, CURLOPT_RETURNTRANSFER => true, - CURLOPT_TIMEOUT => 5, + CURLOPT_TIMEOUT => 30, CURLOPT_HEADER => false, CURLOPT_FAILONERROR => true, ]);