MCPcopy Create free account
hub / github.com/allocnode/oh-my-sage / deleteSession

Method deleteSession

src/server/session/store.ts:309–320  ·  view source on GitHub ↗

* 删除 session

(sessionId: string)

Source from the content-addressed store, hash-verified

307 * 删除 Session
308 */
309 async deleteSession(sessionId: string): Promise<void> {
310 // 删除 Session 文件
311 const sessionPath = this.getSessionPath(sessionId);
312 if (fs.existsSync(sessionPath)) {
313 fs.unlinkSync(sessionPath);
314 }
315
316 // 从索引中移除
317 const index = this.readIndex();
318 index.sessions = index.sessions.filter(s => s.id !== sessionId);
319 this.writeIndex(index);
320 }
321
322 /**
323 * 清空所有 Session

Callers 2

DELETEFunction · 0.80
DELETEFunction · 0.80

Calls 3

getSessionPathMethod · 0.95
readIndexMethod · 0.95
writeIndexMethod · 0.95

Tested by

no test coverage detected