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

Function sampleOldestSession

packages/db/scripts/check-sessions.ts:214–220  ·  view source on GitHub ↗
(
  projectId: string,
  deviceId: string
)

Source from the content-addressed store, hash-verified

212}
213
214async function sampleOldestSession(
215 projectId: string,
216 deviceId: string
217): Promise<IClickhouseSession | null> {
218 const blob = await getRedisCache().get(`session:${projectId}:${deviceId}`);
219 return blob ? getSafeJson<IClickhouseSession>(blob) : null;
220}
221
222async function main() {
223 const args = process.argv.slice(2);

Callers 1

mainFunction · 0.85

Calls 3

getRedisCacheFunction · 0.90
getSafeJsonFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected