Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
feat: Add 300s accelerate cache to feature flags (calcom#11464)
Browse files Browse the repository at this point in the history
  • Loading branch information
emrysal authored Sep 20, 2023
1 parent 5ee9629 commit fd02cc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/features/flags/server/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/features/flags/server/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fd02cc4

Please sign in to comment.