MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getOrCreateSequentialAppend

Function getOrCreateSequentialAppend

src/services/api/sessionIngress.ts:42–55  ·  view source on GitHub ↗

* Gets or creates a sequential wrapper for a session * This ensures that log appends for a session are processed one at a time

(sessionId: string)

Source from the content-addressed store, hash-verified

40 * This ensures that log appends for a session are processed one at a time
41 */
42function getOrCreateSequentialAppend(sessionId: string) {
43 let sequentialAppend = sequentialAppendBySession.get(sessionId)
44 if (!sequentialAppend) {
45 sequentialAppend = sequential(
46 async (
47 entry: TranscriptMessage,
48 url: string,
49 headers: Record<string, string>,
50 ) => await appendSessionLogImpl(sessionId, entry, url, headers),
51 )
52 sequentialAppendBySession.set(sessionId, sequentialAppend)
53 }
54 return sequentialAppend
55}
56
57/**
58 * Internal implementation of appendSessionLog with retry logic

Callers 1

appendSessionLogFunction · 0.85

Calls 4

sequentialFunction · 0.85
appendSessionLogImplFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected