Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

0xphilipp
Copy link
Contributor

No description provided.

.take(limit)
.collect::<StdResult<Vec<_>>>()?;

let mut jobs = vec![];
Copy link
Contributor Author

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(
Copy link
Contributor Author

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>,
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant