From 7907918e81c82a328ac932af4951612e0abedf37 Mon Sep 17 00:00:00 2001 From: Joao Mario Lago Date: Sun, 23 Jun 2024 15:15:37 -0300 Subject: [PATCH] frontend: filebrowser: Add timeout in fetchFolder * Add timeout parameter in fetchFolder since some operations, mainly using mavftp may take longer and need custom timeouts --- core/frontend/src/libs/filebrowser.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/frontend/src/libs/filebrowser.ts b/core/frontend/src/libs/filebrowser.ts index 23fdd45808..4c8c51c123 100644 --- a/core/frontend/src/libs/filebrowser.ts +++ b/core/frontend/src/libs/filebrowser.ts @@ -49,13 +49,14 @@ class Filebrowser { /* Fetch a folder from filebrowser. */ /** * @param folder_path - String absolute path of folder to be fetched + * @param timeout - Timeout in milliseconds * @returns FilebrowserFolder object * */ - async fetchFolder(folder_path: string): Promise { + async fetchFolder(folder_path: string, timeout = 10000): Promise { return back_axios({ method: 'get', url: `${filebrowser_url}/resources${folder_path}`, - timeout: 10000, + timeout, headers: { 'X-Auth': await this.filebrowserToken() }, }) .then((response) => response.data)