Skip to content

Commit 560ddc3

Browse files
query fix
Signed-off-by: sougata-progress <sougatab@progress.com>
1 parent ed61301 commit 560ddc3

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

components/builder-db/src/models/package.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,15 @@ impl Package {
647647
query.filter(packages_with_channel_platform::ident_array.contains(parts.clone()))
648648
.filter(packages_with_channel_platform::visibility.eq_any(visibility.clone()))
649649
.order(packages_with_channel_platform::ident.desc())
650-
.limit(limit as i64)
651-
.offset(offset_val as i64);
650+
.limit(limit)
651+
.offset(offset_val);
652652

653653
let paginated_rows: Vec<PackageWithChannelPlatform> = query_with_pagination.load(conn)?;
654654

655655
// Apply deduplication consistently using unique_by for package identity
656656
let unique_rows: Vec<PackageWithChannelPlatform> =
657657
paginated_rows.into_iter()
658-
.unique_by(|p| (&p.ident, &p.origin))
658+
.unique_by(|p| (p.ident.clone(), p.origin.clone()))
659659
.collect();
660660

661661
unique_rows
@@ -738,15 +738,14 @@ impl Package {
738738
let rows: Vec<(String, String)> =
739739
page_query.limit(limit_i64).offset(offset_i64).load(conn)?;
740740

741-
let pkgs: Vec<BuilderPackageIdent> =
742-
rows.into_iter()
743-
.map(|(origin, name)| {
744-
BuilderPackageIdent(PackageIdent { origin,
741+
let pkgs: Vec<BuilderPackageIdent> = rows.into_iter()
742+
.map(|(origin, name)| {
743+
BuilderPackageIdent(PackageIdent { origin,
745744
name,
746745
version: None,
747746
release: None })
748-
})
749-
.collect();
747+
})
748+
.collect();
750749

751750
let duration_millis = start_time.elapsed().as_millis();
752751
trace!("DBCall package::list_distinct time: {} ms", duration_millis);

0 commit comments

Comments
 (0)