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

Function GoUpdateActivityWrap

pkg/telemetry/telemetry.go:114–127  ·  view source on GitHub ↗

Wraps UpdateCurrentActivity, spawns goroutine, and logs errors

(update wshrpc.ActivityUpdate, debugStr string)

Source from the content-addressed store, hash-verified

112
113// Wraps UpdateCurrentActivity, spawns goroutine, and logs errors
114func GoUpdateActivityWrap(update wshrpc.ActivityUpdate, debugStr string) {
115 go func() {
116 defer func() {
117 panichandler.PanicHandlerNoTelemetry("GoUpdateActivityWrap", recover())
118 }()
119 ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
120 defer cancelFn()
121 err := UpdateActivity(ctx, update)
122 if err != nil {
123 // ignore error, just log, since this is not critical
124 log.Printf("error updating current activity (%s): %v\n", debugStr, err)
125 }
126 }()
127}
128
129func insertTEvent(ctx context.Context, event *telemetrydata.TEvent) error {
130 if event.Uuid == "" {

Callers 5

WshActivityCommandMethod · 0.92
ActivityCommandMethod · 0.92
ConnectMethod · 0.92
ConnectMethod · 0.92
CreateTabFunction · 0.92

Calls 2

PanicHandlerNoTelemetryFunction · 0.92
UpdateActivityFunction · 0.85

Tested by

no test coverage detected