MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getProjectById

Function getProjectById

packages/db/src/services/project.service.ts:14–26  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

12}>;
13
14export async function getProjectById(id: string) {
15 const res = await db.project.findUnique({
16 where: {
17 id,
18 },
19 });
20
21 if (!res) {
22 return null;
23 }
24
25 return res;
26}
27
28/** L1 LRU (60s) + L2 Redis. clear() invalidates Redis + local LRU; other nodes may serve stale from LRU for up to 60s. */
29export const getProjectByIdCached = cacheable(getProjectById, 60 * 60 * 24);

Callers 2

access.service.tsFile · 0.90
dashboard.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected