MCPcopy Index your code
hub / github.com/coder/coder / CollectTasks

Function CollectTasks

coderd/telemetry/telemetry.go:1010–1028  ·  view source on GitHub ↗
(ctx context.Context, db database.Store)

Source from the content-addressed store, hash-verified

1008}
1009
1010func CollectTasks(ctx context.Context, db database.Store) ([]Task, error) {
1011 dbTasks, err := db.ListTasks(ctx, database.ListTasksParams{
1012 OwnerID: uuid.Nil,
1013 OrganizationID: uuid.Nil,
1014 Status: "",
1015 })
1016 if err != nil {
1017 return nil, xerrors.Errorf("list tasks: %w", err)
1018 }
1019 if len(dbTasks) == 0 {
1020 return []Task{}, nil
1021 }
1022
1023 tasks := make([]Task, 0, len(dbTasks))
1024 for _, dbTask := range dbTasks {
1025 tasks = append(tasks, ConvertTask(dbTask))
1026 }
1027 return tasks, nil
1028}
1029
1030// buildTaskEvent constructs a TaskEvent from the combined query row.
1031func buildTaskEvent(

Callers 2

TestTasksTelemetryFunction · 0.92
createSnapshotMethod · 0.85

Calls 3

ConvertTaskFunction · 0.85
ListTasksMethod · 0.65
ErrorfMethod · 0.45

Tested by 1

TestTasksTelemetryFunction · 0.74