Wraps UpdateCurrentActivity, spawns goroutine, and logs errors
(update wshrpc.ActivityUpdate, debugStr string)
| 112 | |
| 113 | // Wraps UpdateCurrentActivity, spawns goroutine, and logs errors |
| 114 | func 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 | |
| 129 | func insertTEvent(ctx context.Context, event *telemetrydata.TEvent) error { |
| 130 | if event.Uuid == "" { |
no test coverage detected