(ctx context.Context, events []*telemetrydata.TEvent)
| 333 | } |
| 334 | |
| 335 | func MarkTEventsAsUploaded(ctx context.Context, events []*telemetrydata.TEvent) error { |
| 336 | return wstore.WithTx(ctx, func(tx *wstore.TxWrap) error { |
| 337 | ids := make([]string, 0, len(events)) |
| 338 | for _, event := range events { |
| 339 | ids = append(ids, event.Uuid) |
| 340 | } |
| 341 | query := `UPDATE db_tevent SET uploaded = 1 WHERE uuid IN (SELECT value FROM json_each(?))` |
| 342 | tx.Exec(query, dbutil.QuickJson(ids)) |
| 343 | return nil |
| 344 | }) |
| 345 | } |
| 346 | |
| 347 | func UpdateActivity(ctx context.Context, update wshrpc.ActivityUpdate) error { |
| 348 | now := time.Now() |
no test coverage detected