Skip to content

Commit

Permalink
revert a change and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Jan 5, 2024
1 parent caf6433 commit 031e003
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions flow/cmd/mirror_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ func (h *FlowRequestHandler) getPartitionStatuses(
ctx context.Context,
flowJobName string,
) ([]*protos.PartitionStatus, error) {
q := "SELECT start_time, end_time, rows_in_partition FROM peerdb_stats.qrep_partitions WHERE flow_name ILIKE $1"
rows, err := h.pool.Query(ctx, q, "clone_"+flowJobName+"_%")
q := "SELECT start_time, end_time, rows_in_partition FROM peerdb_stats.qrep_partitions WHERE flow_name = $1"
rows, err := h.pool.Query(ctx, q, flowJobName)
if err != nil {
slog.Error(fmt.Sprintf("unable to query qrep partition - %s: %s", flowJobName, err.Error()))
return nil, fmt.Errorf("unable to query qrep partition - %s: %w", flowJobName, err)
Expand Down
32 changes: 16 additions & 16 deletions ui/app/mirrors/status/qrep/[mirrorId]/qrepStatusTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,27 @@ export default function QRepStatusTable({
const [sortDir, setSortDir] = useState<'asc' | 'dsc'>('dsc');
const displayedPartitions = useMemo(() => {
let currentPartitions = [...visiblePartitions];
(currentPartitions = currentPartitions.filter(
currentPartitions = currentPartitions.filter(
(partition: QRepPartitionStatus) => {
return partition.partitionId
.toLowerCase()
.includes(searchQuery.toLowerCase());
}
)),
currentPartitions.sort((a, b) => {
const aValue = a[sortField];
const bValue = b[sortField];
if (aValue === null || bValue === null) {
return 0;
}
if (aValue < bValue) {
return sortDir === 'dsc' ? 1 : -1;
} else if (aValue > bValue) {
return sortDir === 'dsc' ? -1 : 1;
} else {
return 0;
}
});
);
currentPartitions.sort((a, b) => {
const aValue = a[sortField];
const bValue = b[sortField];
if (aValue === null || bValue === null) {
return 0;
}
if (aValue < bValue) {
return sortDir === 'dsc' ? 1 : -1;
} else if (aValue > bValue) {
return sortDir === 'dsc' ? -1 : 1;
} else {
return 0;
}
});
return currentPartitions;
}, [visiblePartitions, searchQuery, sortField, sortDir]);

Expand Down

0 comments on commit 031e003

Please sign in to comment.