MCPcopy
hub / github.com/coder/mux / load

Method load

src/node/services/memoryMeta.ts:131–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129 }
130
131 private async load(): Promise<MemoryMetaFile> {
132 if (this.cache !== null) return this.cache;
133 let parsed: unknown = null;
134 try {
135 parsed = JSON.parse(await fsPromises.readFile(this.metaPath, "utf-8"));
136 } catch (error) {
137 // Missing file is the normal first-run case; anything else is healed to empty.
138 if ((error as NodeJS.ErrnoException).code !== "ENOENT") {
139 log.debug("[MemoryMetaService] healing unreadable sidecar", { error });
140 }
141 }
142 this.cache = sanitizeMetaFile(parsed);
143 return this.cache;
144 }
145
146 /**
147 * Read-modify-write cycle under the sidecar mutex. Persists before updating

Callers 6

mutateMethod · 0.95
getPinnedKeysMethod · 0.95
getEntriesMethod · 0.95
preloadTerminalWebfontsFunction · 0.45

Calls 4

sanitizeMetaFileFunction · 0.85
debugMethod · 0.80
readFileMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected