MCPcopy Index your code
hub / github.com/Noumena-Network/code / flush

Method flush

src/utils/sessionStorage.ts:922–942  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

920 }
921
922 async flush(): Promise<void> {
923 // Cancel pending timer
924 if (this.flushTimer) {
925 clearTimeout(this.flushTimer)
926 this.flushTimer = null
927 }
928 // Wait for any in-flight drain to finish
929 if (this.activeDrain) {
930 await this.activeDrain
931 }
932 // Drain anything remaining in the queues
933 await this.drainWriteQueue()
934
935 // Wait for non-queue tracked operations (e.g. removeMessageByUuid)
936 if (this.pendingWriteCount === 0) {
937 return
938 }
939 return new Promise<void>(resolve => {
940 this.flushResolvers.push(resolve)
941 })
942 }
943
944 /**
945 * Remove a message from the transcript by UUID.

Callers 11

relay_execFunction · 0.45
write_json_lineFunction · 0.45
getProjectFunction · 0.45
flushSessionStorageFunction · 0.45
flushAsciicastRecorderFunction · 0.45
flushFunction · 0.45
flushDebugLogsFunction · 0.45
flushFunction · 0.45
flushAndCleanupFunction · 0.45

Calls 1

drainWriteQueueMethod · 0.95

Tested by

no test coverage detected