From 82289f28bbe63c9f521dfbc122862de17049ebab Mon Sep 17 00:00:00 2001 From: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com> Date: Tue, 12 Aug 2025 13:46:56 +0530 Subject: [PATCH] fix: initiate cache only when lighthouse config is active --- ui/components/lighthouse/banner.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/components/lighthouse/banner.tsx b/ui/components/lighthouse/banner.tsx index 9c07c6e655..707028910b 100644 --- a/ui/components/lighthouse/banner.tsx +++ b/ui/components/lighthouse/banner.tsx @@ -34,9 +34,6 @@ const renderBanner = ({ message, href, gradient }: BannerConfig) => ( // If recommendation is being processed, returns a banner with a different message export const LighthouseBanner = async () => { try { - // Triggers a background job to process the scans and generate recommendations - await initializeTenantCache(); - const lighthouseConfig = await getLighthouseConfig(); if (!lighthouseConfig) { @@ -48,6 +45,11 @@ export const LighthouseBanner = async () => { }); } + // If lighthouse is active, trigger background job to process the scans and generate recommendations + if (lighthouseConfig.attributes.is_active) { + await initializeTenantCache(); + } + // Check if recommendation is being processed const isProcessing = await CacheService.isRecommendationProcessing();