MCPcopy Create free account
hub / github.com/msgbyte/tailchat / getCachedUserInfo

Function getCachedUserInfo

client/shared/cache/cache.ts:36–49  ·  view source on GitHub ↗
(
  userId: string,
  refetch = false
)

Source from the content-addressed store, hash-verified

34 * 获取缓存的用户信息
35 */
36export async function getCachedUserInfo(
37 userId: string,
38 refetch = false
39): Promise<UserBaseInfo> {
40 const data = await queryClient.fetchQuery(
41 [CacheKey.user, userId],
42 () => fetchUserInfo(userId),
43 {
44 staleTime: refetch ? 0 : 2 * 60 * 60 * 1000, // 缓存2小时
45 }
46 );
47
48 return data;
49}
50
51/**
52 * 获取缓存的会话信息

Callers 10

getDMConverseNameFunction · 0.90
useUserInfoListFunction · 0.90
useCachedUserInfoFunction · 0.90
index.tsxFile · 0.85
SidebarDMItem.tsxFile · 0.85
index.tsxFile · 0.85
initNotifyFunction · 0.85
popover.tsxFile · 0.85
index.tsxFile · 0.85
inviteUsersFunction · 0.85

Calls 1

fetchUserInfoFunction · 0.90

Tested by

no test coverage detected