From 1071a0b42a7fe83a4754985c6fdf64ed56785767 Mon Sep 17 00:00:00 2001 From: naman-contentstack Date: Thu, 17 Jul 2025 12:20:40 +0530 Subject: [PATCH] added a delay to check failing test case --- packages/contentstack-utilities/src/authentication-handler.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/contentstack-utilities/src/authentication-handler.ts b/packages/contentstack-utilities/src/authentication-handler.ts index 271aed8a35..c053b3e823 100644 --- a/packages/contentstack-utilities/src/authentication-handler.ts +++ b/packages/contentstack-utilities/src/authentication-handler.ts @@ -52,6 +52,10 @@ class AuthenticationHandler { } async refreshAccessToken(error: any, maxRetryCount = 1): Promise { + // Add delay to prevent burst requests and help diagnose GoCD pipeline failures + console.log('Adding delay before processing refreshAccessToken...'); + await new Promise((resolve) => setTimeout(resolve, 2000)); // 2 second delay + console.log('Delay completed, processing refreshAccessToken'); if (error.response && error.response.status) { switch (error.response.status) { case 401: