From 29b6cb3ab64390ef5643e15f06a8fb642a513b9b Mon Sep 17 00:00:00 2001 From: Aloisio Bastian Date: Wed, 26 Feb 2025 19:26:10 -0300 Subject: [PATCH] chore: fix clean up action timeout to be executed between resources deletion (#2228) --- scripts/cleanup.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/cleanup.js b/scripts/cleanup.js index afe6356f6..a1652e259 100644 --- a/scripts/cleanup.js +++ b/scripts/cleanup.js @@ -114,6 +114,8 @@ const deleteResources = async ( `🗑️ Deleted resource: ${singleResourceUrl} - Status code: ${deleteResponse.status}` ) deletedCount++ + console.log(`⏳ Waiting for ${wait_time} seconds before continuing...`) + await setTimeout(wait_time * 1000) } catch (error) { console.error(`❌ Error deleting resource with ID ${resource.id}: ${error.message}`) } @@ -126,9 +128,6 @@ const deleteResources = async ( console.log('✅ No resources deleted in this iteration.') break } - - console.log(`⏳ Waiting for ${wait_time} seconds before continuing...`) - await setTimeout(wait_time * 1000) } }