MCPcopy Create free account
hub / github.com/MemTensor/MemOS / initOnlineTracking

Method initOnlineTracking

packages/memos-core/src/hub/server.ts:1089–1101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1087 }
1088
1089 private initOnlineTracking(): void {
1090 try {
1091 const ownerId = this.authState.bootstrapAdminUserId || "";
1092 const users = this.opts.store.listHubUsers("active");
1093 const now = Date.now();
1094 for (const u of users) {
1095 if (u.id === ownerId) continue;
1096 if (u.lastActiveAt && now - u.lastActiveAt < HubServer.OFFLINE_THRESHOLD_MS) {
1097 this.knownOnlineUsers.add(u.id);
1098 }
1099 }
1100 } catch { /* best-effort */ }
1101 }
1102
1103 private checkOfflineUsers(): void {
1104 try {

Callers 1

startMethod · 0.95

Calls 2

listHubUsersMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected