MCPcopy
hub / github.com/CapSoftware/Cap / touch

Method touch

packages/recorder-core/src/recording-spool.ts:311–331  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

309 // poison the write queue — a missed heartbeat must never degrade an
310 // otherwise healthy spool.
311 touch(): Promise<void> {
312 if (this.disposed || this.writeError) {
313 return Promise.resolve();
314 }
315
316 const operation = this.pendingWrite.then(async () => {
317 if (this.disposed || this.writeError) return;
318 const updatedSession = {
319 ...this.session,
320 updatedAt: Date.now(),
321 } satisfies RecordingSpoolSessionRecord;
322 await this.backend.createSession(updatedSession);
323 this.session = updatedSession;
324 });
325 this.pendingWrite = operation.then(
326 () => undefined,
327 () => undefined,
328 );
329
330 return operation.catch(() => undefined);
331 }
332
333 async flush() {
334 await this.pendingWrite;

Callers 2

useWebRecorderFunction · 0.80

Calls 1

createSessionMethod · 0.65

Tested by

no test coverage detected