From 2dc9be929ca3a339860a900cb4d5b655daf86d8c Mon Sep 17 00:00:00 2001 From: Toddyn <86982643+ToddyTheNoobDud@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:05:32 -0300 Subject: [PATCH] Add support For undici Garbage Collector Workaround with https://github.com/nodejs/undici/pull/3916#issue-2712258432 --- build/handlers/fetchImage.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/handlers/fetchImage.js b/build/handlers/fetchImage.js index 1dea44b..9da5b69 100644 --- a/build/handlers/fetchImage.js +++ b/build/handlers/fetchImage.js @@ -23,9 +23,8 @@ async function getImageUrl(info) { async function fetchThumbnail(url) { try { const response = await request(url, { method: "GET" }); - const json = await response.json(); - response.body.destroy(); - + const json = await response.body.json(); + response.body.dump(); return json.thumbnail_url || null; } catch (error) { console.error(`Error fetching ${url}:`, error);