Skip to content

Recently updated sort #1264

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

Merged
merged 4 commits into from
Jul 21, 2018
Merged

Conversation

moore3071
Copy link
Contributor

Allow sorting by which crates were most recently updated as mentioned in #1210. The option is called 'recent-updates' in order to match the naming convention of 'recent-downloads'

@carols10cents
Copy link
Member

Oh geez I am so sorry to have let this sit for so long. This is actually important for performance reasons for an API user of ours.

@jtgeibel @sgrif could yinz prioritize code review of this please?

@carols10cents carols10cents requested review from jtgeibel and sgrif April 17, 2018 17:33
@sgrif
Copy link
Contributor

sgrif commented Apr 19, 2018

Will take care of it when I'm back from RailsConf

@sgrif sgrif self-assigned this Apr 19, 2018
@sgrif
Copy link
Contributor

sgrif commented Apr 23, 2018

Is there a reason we needed to introduce the time crate just for this? Could this be done with std::time::Duration or chrono::Duration?

sgrif
sgrif previously requested changes Apr 23, 2018
Copy link
Contributor

@sgrif sgrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to do all the time calculations in the database using Diesel, shouldn't need to involve time, chrono, or any Durations. Other than that this just needs a rebase.

// Set the updated at column for each crate
let updated = Utc::now().naive_utc();
update(&krate1)
.set(crates::updated_at.eq(updated - Duration::weeks(3)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to do this in Rust. This can just be now - 3.weeks() (use diesel::dsl::*)

@carols10cents carols10cents force-pushed the recently_updated_sort branch from 4130b9e to cb6c362 Compare July 19, 2018 00:16
@carols10cents
Copy link
Member

I did a rebase and a force-push to avoid having to merge and then revert the Cargo.toml changes 😅 Sorry for letting this sit so long!

@carols10cents
Copy link
Member

bors: r+

bors-voyager bot added a commit that referenced this pull request Jul 21, 2018
1264: Recently updated sort r=carols10cents a=moore3071

Allow sorting by which crates were most recently updated as mentioned in #1210. The option is called 'recent-updates' in order to match the naming convention of 'recent-downloads'

Co-authored-by: Brandon Moore <[email protected]>
Co-authored-by: Carol (Nichols || Goulding) <[email protected]>
@bors-voyager
Copy link
Contributor

bors-voyager bot commented Jul 21, 2018

Build succeeded

@bors-voyager bors-voyager bot merged commit 3891810 into rust-lang:master Jul 21, 2018
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.

3 participants