fix: initiate cache only when lighthouse config is active

This commit is contained in:
Chandrapal Badshah
2025-08-12 13:46:56 +05:30
parent a5b59bc346
commit 82289f28bb
+5 -3
View File
@@ -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();