MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / shutdownActivityUpdate

Function shutdownActivityUpdate

cmd/server/main-server.go:366–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

364}
365
366func shutdownActivityUpdate() {
367 ctx, cancelFn := context.WithTimeout(context.Background(), 1*time.Second)
368 defer cancelFn()
369 activity := wshrpc.ActivityUpdate{Shutdown: 1}
370 err := telemetry.UpdateActivity(ctx, activity) // do NOT use the go routine wrap here (this needs to be synchronous)
371 if err != nil {
372 log.Printf("error updating shutdown activity: %v\n", err)
373 }
374 err = telemetry.TruncateActivityTEventForShutdown(ctx)
375 if err != nil {
376 log.Printf("error truncating activity t-event for shutdown: %v\n", err)
377 }
378 tevent := telemetrydata.MakeTEvent("app:shutdown", telemetrydata.TEventProps{})
379 err = telemetry.RecordTEvent(ctx, tevent)
380 if err != nil {
381 log.Printf("error recording shutdown event: %v\n", err)
382 }
383}
384
385func createMainWshClient() {
386 rpc := wshserver.GetMainRpcClient()

Callers 1

doShutdownFunction · 0.85

Calls 4

UpdateActivityFunction · 0.92
MakeTEventFunction · 0.92
RecordTEventFunction · 0.92

Tested by

no test coverage detected