Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Nov 4, 2024
1 parent 7150848 commit 30553b4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flow/cmd/mirror_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ func (h *FlowRequestHandler) cdcFlowStatus(

func (h *FlowRequestHandler) CDCGraph(ctx context.Context, req *protos.GraphRequest) (*protos.GraphResponse, error) {
truncField := "minute"
switch req.AggregateType {
case "hour", "day", "month":
if slices.Contains([]string{"hour", "day", "month"}, req.AggregateType) {
truncField = req.AggregateType
}
rows, err := h.pool.Query(ctx, `select tm, coalesce(sum(rows_in_batch), 0)
Expand Down Expand Up @@ -512,7 +511,7 @@ func (h *FlowRequestHandler) CDCBatches(ctx context.Context, req *protos.GetCDCB
} else if req.AfterId != -1 {
queryArgs = append(queryArgs, req.AfterId)
whereExpr = fmt.Sprintf(" AND batch_id > $%d", len(queryArgs))
sortOrderBy = ""
sortOrderBy = "asc"
}
}

Expand Down Expand Up @@ -569,7 +568,7 @@ func (h *FlowRequestHandler) CDCBatches(ctx context.Context, req *protos.GetCDCB
if batches == nil {
batches = []*protos.CDCBatch{}
}
if req.Ascending != (sortOrderBy == "") {
if req.Ascending != (sortOrderBy == "asc") {
slices.Reverse(batches)
}

Expand Down

0 comments on commit 30553b4

Please sign in to comment.