MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / clearAvgCache

Function clearAvgCache

admin_board/admin_board.ts:497–518  ·  view source on GitHub ↗
(target?: TargetChat)

Source from the content-addressed store, hash-verified

495 const prefix = `${target.storageKey}:`;
496 const keys = Object.keys(db.data.values).filter((key) =>
497 key.startsWith(prefix),
498 );
499
500 for (const key of keys) {
501 delete db.data.values[key];
502 }
503
504 await db.write();
505 return keys.length;
506}
507
508async function getLockedSeatSet(target: TargetChat): Promise<Set<string>> {
509 const db = await getSeatLockDb();
510 return new Set(db.data.lockedSeats[target.storageKey] || []);
511}
512
513async function updateLockedSeats(
514 target: TargetChat,
515 userIds: string[],
516 locked: boolean,
517): Promise<void> {
518 const db = await getSeatLockDb();
519 const current = new Set(db.data.lockedSeats[target.storageKey] || []);
520
521 for (const userId of userIds) {

Callers 1

handleClearCacheActionFunction · 0.85

Calls 2

getAvgCacheDbFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected