From 95e8492c5dea75f62562ce333d09c6fe3d7b4966 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Thu, 6 Aug 2020 20:25:35 -0700 Subject: [PATCH] What the heck are these abysmal timeouts; closes #2223 --- app/Repositories/Wings/DaemonFileRepository.php | 3 +++ config/pterodactyl.php | 4 ++-- resources/scripts/api/server/files/compressFiles.ts | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Repositories/Wings/DaemonFileRepository.php b/app/Repositories/Wings/DaemonFileRepository.php index 177f22afd..553e39d24 100644 --- a/app/Repositories/Wings/DaemonFileRepository.php +++ b/app/Repositories/Wings/DaemonFileRepository.php @@ -230,6 +230,9 @@ class DaemonFileRepository extends DaemonRepository 'root' => $root ?? '/', 'files' => $files, ], + // Wait for up to 15 minutes for the archive to be completed when calling this endpoint + // since it will likely take quite awhile for large directories. + 'timeout' => 60 * 15, ] ); } catch (TransferException $exception) { diff --git a/config/pterodactyl.php b/config/pterodactyl.php index 70014bc0a..b37790cbc 100644 --- a/config/pterodactyl.php +++ b/config/pterodactyl.php @@ -85,8 +85,8 @@ return [ | Configure the timeout to be used for Guzzle connections here. */ 'guzzle' => [ - 'timeout' => env('GUZZLE_TIMEOUT', 5), - 'connect_timeout' => env('GUZZLE_CONNECT_TIMEOUT', 3), + 'timeout' => env('GUZZLE_TIMEOUT', 30), + 'connect_timeout' => env('GUZZLE_CONNECT_TIMEOUT', 10), ], /* diff --git a/resources/scripts/api/server/files/compressFiles.ts b/resources/scripts/api/server/files/compressFiles.ts index 0554c7fd9..4204f0884 100644 --- a/resources/scripts/api/server/files/compressFiles.ts +++ b/resources/scripts/api/server/files/compressFiles.ts @@ -4,8 +4,8 @@ import { rawDataToFileObject } from '@/api/transformers'; export default async (uuid: string, directory: string, files: string[]): Promise => { const { data } = await http.post(`/api/client/servers/${uuid}/files/compress`, { root: directory, files }, { - timeout: 300000, - timeoutErrorMessage: 'It looks like this archive is taking a long time to generate. It will appear when completed.', + timeout: 60000, + timeoutErrorMessage: 'It looks like this archive is taking a long time to generate. It will appear once completed.', }); return rawDataToFileObject(data);