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

Function getCachedAckInfo

client/shared/cache/cache.ts:96–117  ·  view source on GitHub ↗
(converseId: string, refetch = false)

Source from the content-addressed store, hash-verified

94 * 获取缓存的用户信息
95 */
96export async function getCachedAckInfo(converseId: string, refetch = false) {
97 const data = await queryClient.fetchQuery(
98 [CacheKey.converseAck, converseId],
99 () => {
100 return Promise.all([
101 getConverseAckInfo([converseId]).then((d) => d[0]),
102 getConverseLastMessageInfo([converseId]).then((d) => d[0]),
103 ]).then(([ack, lastMessage]) => {
104 return {
105 converseId,
106 ack,
107 lastMessage,
108 };
109 });
110 },
111 {
112 staleTime: 2 * 1000, // 缓存2s, 减少一秒内的重复请求(无意义)
113 }
114 );
115
116 return data;
117}
118
119/**
120 * 获取缓存的插件列表

Callers 1

useAckInfoCheckerFunction · 0.90

Calls 3

getConverseAckInfoFunction · 0.90
allMethod · 0.45

Tested by

no test coverage detected