MCPcopy
hub / github.com/wavetermdev/waveterm / writeJobTerminationMessage

Function writeJobTerminationMessage

pkg/jobcontroller/jobcontroller.go:1604–1615  ·  view source on GitHub ↗
(ctx context.Context, jobId string, job *waveobj.Job, msg string)

Source from the content-addressed store, hash-verified

1602}
1603
1604func writeJobTerminationMessage(ctx context.Context, jobId string, job *waveobj.Job, msg string) {
1605 if job == nil {
1606 return
1607 }
1608 shouldWrite := jobTerminationMessageWritten.TestAndSet(jobId, true, func(val bool, exists bool) bool {
1609 return !exists || !val
1610 })
1611 if shouldWrite {
1612 resetTerminalState(ctx, job.AttachedBlockId)
1613 writeMutedMessageToTerminal(job.AttachedBlockId, msg)
1614 }
1615}

Callers 1

doReconnectJobFunction · 0.85

Calls 3

resetTerminalStateFunction · 0.85
TestAndSetMethod · 0.80

Tested by

no test coverage detected