-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support query by id ascending to support synchronization of pending jobs #24
base: master
Are you sure you want to change the base?
support query by id ascending to support synchronization of pending jobs #24
Conversation
.take(limit) | ||
.collect::<StdResult<Vec<_>>>()?; | ||
|
||
let mut jobs = vec![]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also optimized this to do it directly in the map to not copy the whole list again and reiterate it.
let infos = map | ||
.range(deps.storage, start, None, Order::Ascending) | ||
.filter(|h| { | ||
resolve_filters( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of cloning everything, it could be better to just borrow things. For small structs cloning is better, but not sure about strings etc.
@@ -92,6 +92,7 @@ pub struct QueryJobsMsg { | |||
pub condition_status: Option<bool>, | |||
pub start_after: Option<JobIndex>, | |||
pub limit: Option<u32>, | |||
pub use_id_order: Option<bool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is set to true and no ids provided, the order will be by id ascending
No description provided.