Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

feat: add CE no-op license boot sync hook (#1665)

Aman Agarwal8c3fd5b87c32
diff --git a/src/client/src/instrumentation.ts b/src/client/src/instrumentation.ts
index dc3ba4f1..29676558 100644
--- a/src/client/src/instrumentation.ts
+++ b/src/client/src/instrumentation.ts
@@ -78,6 +78,25 @@ export async function register() {
console.error("❌ Error installing telemetry snapshot cron:", error);
}
+ try {
+ // Boot sync for active enterprise licenses (at most every 6h).
+ // Neutral path: CE no-op; EE resolves via `@/lib/*` → `ee/lib/*`.
+ const { syncAllActiveLicensesIfDue } = await import(
+ "@/lib/license-boot-sync"
+ );
+ console.log("🔑 Syncing active enterprise licenses if due...");
+ const syncResult = await syncAllActiveLicensesIfDue();
+ if (syncResult.ran) {
+ console.log(
+ `✅ License sync completed for ${syncResult.organisations} organisation(s)`
+ );
+ } else {
+ console.log("⏭️ License sync skipped (not due or offline)");
+ }
+ } catch (error) {
+ console.error("❌ Error syncing enterprise licenses on startup:", error);
+ }
+
console.log("✨ Server initialization complete");
}
}
diff --git a/src/client/src/lib/license-boot-sync.ts b/src/client/src/lib/license-boot-sync.ts
new file mode 100644
index 00000000..5d9ea6b6
--- /dev/null
+++ b/src/client/src/lib/license-boot-sync.ts
@@ -0,0 +1,10 @@
+/**
+ * CE no-op: enterprise overlays this via `@/lib/*` → `ee/lib/*`.
+ * Boot/periodic license sync is an EE-only concern.
+ */
+export async function syncAllActiveLicensesIfDue(): Promise<{
+ ran: boolean;
+ organisations: number;
+}> {
+ return { ran: false, organisations: 0 };
+}