diff --git a/packages/features/ee/common/server/LicenseKeyService.test.ts b/packages/features/ee/common/server/LicenseKeyService.test.ts index d56a6dccf8..ad3e5b0aa4 100644 --- a/packages/features/ee/common/server/LicenseKeyService.test.ts +++ b/packages/features/ee/common/server/LicenseKeyService.test.ts @@ -92,6 +92,7 @@ describe("LicenseKeyService", () => { }, method: "POST", mode: "cors", + signal: expect.any(AbortSignal), }); }); @@ -113,6 +114,7 @@ describe("LicenseKeyService", () => { }, method: "POST", mode: "cors", + signal: expect.any(AbortSignal), }); }); }); @@ -161,6 +163,7 @@ describe("LicenseKeyService", () => { "x-cal-license-key": "test-license-key", }, mode: "cors", + signal: expect.any(AbortSignal), }); }); @@ -184,6 +187,7 @@ describe("LicenseKeyService", () => { "x-cal-license-key": "test-license-key", }, mode: "cors", + signal: expect.any(AbortSignal), }); }); }); diff --git a/packages/features/ee/common/server/LicenseKeyService.ts b/packages/features/ee/common/server/LicenseKeyService.ts index 099579edcc..1f5b215b3b 100644 --- a/packages/features/ee/common/server/LicenseKeyService.ts +++ b/packages/features/ee/common/server/LicenseKeyService.ts @@ -62,6 +62,8 @@ class LicenseKeyService implements ILicenseKeyService { ...options, headers: headers, body: JSON.stringify(body), + // In case of hang, abort the operation after 2 seconds + signal: AbortSignal.timeout(2000), }); }