feat: Add 300s accelerate cache to feature flags (#11464)
parent
5ee962948f
commit
fd02cc44fa
|
@ -8,6 +8,7 @@ export const featureFlagRouter = router({
|
|||
const { prisma } = ctx;
|
||||
return prisma.feature.findMany({
|
||||
orderBy: { slug: "asc" },
|
||||
cacheStrategy: { swr: 300, ttl: 300 },
|
||||
});
|
||||
}),
|
||||
map: publicProcedure.query(async ({ ctx }) => {
|
||||
|
|
|
@ -5,6 +5,7 @@ import type { AppFlags } from "../config";
|
|||
export async function getFeatureFlagMap(prisma: PrismaClient) {
|
||||
const flags = await prisma.feature.findMany({
|
||||
orderBy: { slug: "asc" },
|
||||
cacheStrategy: { swr: 300, ttl: 300 },
|
||||
});
|
||||
return flags.reduce<AppFlags>((acc, flag) => {
|
||||
acc[flag.slug as keyof AppFlags] = flag.enabled;
|
||||
|
|
Loading…
Reference in New Issue