diff --git a/pkg/schema/v1/container.go b/pkg/schema/v1/container.go index 2f3a70a4..8828c872 100644 --- a/pkg/schema/v1/container.go +++ b/pkg/schema/v1/container.go @@ -289,9 +289,13 @@ func SyncContainers(ctx context.Context, db *database.Database, g *errgroup.Grou func warmup(ctx context.Context, db *database.Database) error { g, ctx := errgroup.WithContext(ctx) + query := `SELECT cl.* FROM container_log cl INNER JOIN (SELECT container_id, pod_id, MAX(last_update) as last_update + FROM container_log GROUP BY container_id) max_cl ON cl.container_id = max_cl.container_id AND cl.pod_id = max_cl.pod_id + AND cl.last_update = max_cl.last_update` + entities, errs := db.YieldAll(ctx, func() (interface{}, error) { return &ContainerLog{}, nil - }, db.BuildSelectStmt(ContainerLog{}, ContainerLog{})) + }, query) com.ErrgroupReceive(ctx, g, errs) g.Go(func() error {