MCPcopy Create free account
hub / github.com/garrytan/gstack / tmpStatePath

Function tmpStatePath

browse/src/server.ts:559–561  ·  view source on GitHub ↗

* Per-process state-file temp path. The state-file write pattern is * `writeFileSync(tmp, ...) → renameSync(tmp, stateFile)` for atomicity, * but a shared `${stateFile}.tmp` filename means two concurrent writers * (cold-start race when N CLIs hit a fresh repo simultaneously, parallel * /tunnel/s

()

Source from the content-addressed store, hash-verified

557 * concurrent writers no longer kill each other on the rename.
558 */
559function tmpStatePath(): string {
560 return `${config.stateFile}.tmp.${process.pid}.${crypto.randomBytes(4).toString('hex')}`;
561}
562
563
564// ─── Sidebar agent / chat state ripped ──────────────────────────────

Callers 2

makeFetchHandlerFunction · 0.85
startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected