MCPcopy Index your code
hub / github.com/simstudioai/sim / startKeepalive

Method startKeepalive

apps/sim/lib/copilot/request/session/writer.ts:67–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65 }
66
67 startKeepalive(): void {
68 this.keepaliveInterval = setInterval(() => {
69 if (this._clientDisconnected || !this.controller) return
70 try {
71 this.controller.enqueue(encodeSSEComment('keepalive'))
72 } catch (error) {
73 this._clientDisconnected = true
74 logger.warn('Keepalive enqueue failed, marking client disconnected', {
75 streamId: this.streamId,
76 requestId: this.requestId,
77 error: toError(error).message,
78 })
79 }
80 }, this.keepaliveMs)
81 }
82
83 stopKeepalive(): void {
84 if (this.keepaliveInterval) {

Callers 1

startFunction · 0.80

Calls 4

encodeSSECommentFunction · 0.90
toErrorFunction · 0.90
enqueueMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected