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

Function MarkTEventsAsUploaded

pkg/telemetry/telemetry.go:335–345  ·  view source on GitHub ↗
(ctx context.Context, events []*telemetrydata.TEvent)

Source from the content-addressed store, hash-verified

333}
334
335func 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
347func UpdateActivity(ctx context.Context, update wshrpc.ActivityUpdate) error {
348 now := time.Now()

Callers 1

sendTEventsBatchFunction · 0.92

Calls 2

WithTxFunction · 0.92
QuickJsonFunction · 0.92

Tested by

no test coverage detected