Skip to content

Commit 8ba8dec

Browse files
committed
feat: add singleton instance for rate limit system
Initialize the RateLimitSystem as a singleton to ensure a shared instance across the application, preventing redundant database connection handling.
1 parent a5a1774 commit 8ba8dec

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { prisma } from "~/db.server";
2+
import { RateLimitSystem } from "./rateLimitSystem.server";
3+
import { singleton } from "~/utils/singleton";
4+
5+
export const rateLimitSystem = singleton(
6+
"rateLimitSystem",
7+
() => new RateLimitSystem(prisma)
8+
);

0 commit comments

Comments
 (0)