MCPcopy
hub / github.com/di-sukharev/opencommit / set

Method set

out/cli.cjs:53053–53062  ·  view source on GitHub ↗
(sessionKey, session)

Source from the content-addressed store, hash-verified

53051 SessionCache = class SimpleSessionCache {
53052 constructor(maxCachedSessions) {
53053 this._maxCachedSessions = maxCachedSessions;
53054 this._sessionCache = /* @__PURE__ */ new Map();
53055 }
53056 get(sessionKey) {
53057 return this._sessionCache.get(sessionKey);
53058 }
53059 set(sessionKey, session) {
53060 if (this._maxCachedSessions === 0) {
53061 return;
53062 }
53063 if (this._sessionCache.size >= this._maxCachedSessions) {
53064 const { value: oldestKey } = this._sessionCache.keys().next();
53065 this._sessionCache.delete(oldestKey);

Callers

nothing calls this directly

Calls 4

nextMethod · 0.45
keysMethod · 0.45
deleteMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected