From 34671c6b13ba465f431607f9a47b41d9f3afe175 Mon Sep 17 00:00:00 2001 From: Shlee Date: Sun, 16 Aug 2026 21:58:08 +0930 Subject: [PATCH] Update license.ts --- server/private/license/license.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/server/private/license/license.ts b/server/private/license/license.ts index 649c3ab2e..9ecefda0c 100644 --- a/server/private/license/license.ts +++ b/server/private/license/license.ts @@ -149,12 +149,8 @@ LQIDAQAB } // Count used sites and users for license comparison - const [siteCountRes] = await db - .select({ value: count() }) - .from(sites); - const [userCountRes] = await db - .select({ value: count() }) - .from(users); + const [siteCountRes] = await db.select({ value: count() }).from(sites); + const [userCountRes] = await db.select({ value: count() }).from(users); const status: LicenseStatus = { hostId: this.hostMeta.hostMetaId, @@ -277,9 +273,7 @@ LQIDAQAB `Allowing failure. Will retry one more time at next run interval.` ); // return last known good status - return this.statusCache.get( - this.statusKey - ) as LicenseStatus; + return status; } else { // Subsequent failures: fail abruptly throw e; @@ -368,10 +362,7 @@ LQIDAQAB } // Only consider quantity if defined and >= 0 (quantity = users, quantity_2 = sites) - if ( - cached.quantity_2 !== undefined && - cached.quantity_2 >= 0 - ) { + if (cached.quantity_2 !== undefined && cached.quantity_2 >= 0) { status.maxSites = (status.maxSites ?? 0) + cached.quantity_2; } @@ -561,7 +552,7 @@ LQIDAQAB // Calculate exponential backoff delay const retryDelay = Math.floor( initialRetryDelay * - Math.pow(exponentialFactor, attempt - 1) + Math.pow(exponentialFactor, attempt - 1) ); logger.debug(