Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
simke9445 committed Jan 12, 2024
1 parent 7a14125 commit 0abc781
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions contracts/warp-controller/src/query/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ pub fn query_jobs(deps: Deps, env: Env, data: QueryJobsMsg) -> StdResult<JobsRes
deps,
env,
name,
owner,
job_status,
start_after.map(|i| (owner.to_string(), i._1.u64())),
start_after.map(|i| (i._1.u64())),
page_size as usize,
),
QueryJobsMsg {
Expand Down Expand Up @@ -151,11 +152,12 @@ pub fn query_jobs_by_owner(
deps: Deps,
env: Env,
name: Option<String>,
owner: Addr,
job_status: Option<JobStatus>,
start_after: Option<(String, u64)>,
start_after: Option<u64>,
limit: usize,
) -> StdResult<JobsResponse> {
let start = start_after.map(Bound::inclusive);
let start = start_after.map(Bound::exclusive);
let map = if job_status.is_some() && job_status.clone().unwrap() != JobStatus::Pending {
FINISHED_JOBS()
} else {
Expand All @@ -164,6 +166,7 @@ pub fn query_jobs_by_owner(
let infos = map
.idx
.owner
.prefix(owner.to_string())
.range(deps.storage, start, None, Order::Ascending)
.filter(|h| {
resolve_filters(
Expand Down

0 comments on commit 0abc781

Please sign in to comment.