perf: use Redis for faster system preference check
All checks were successful
Integration Tests / integration-tests (pull_request) Successful in 52s

This commit is contained in:
2026-03-03 21:49:32 +07:00
parent 02ad14d382
commit 5a7f9bbebe

View File

@ -1,10 +1,14 @@
import { AppError } from "../../../helpers/error/instances/app";
import { ErrorForwarder } from "../../../helpers/error/instances/forwarder";
import { findSystemPreferenceService } from "../../systemPreference/services/internal/findSystemPreference.service";
import { findAllActiveHeroBannerRepository } from "../repositories/GET/findAllActiveHeroBanner.repository";
export const getActiveHeroBannerService = async () => {
try {
const isHeroBannerEnabled = process.env.ENABLE_HERO_BANNER === "true";
const isHeroBannerEnabled = await findSystemPreferenceService(
"HERO_BANNER_ENABLED",
"boolean",
);
if (!isHeroBannerEnabled)
throw new AppError(403, "Hero Banner is disabled");