-
Notifications
You must be signed in to change notification settings - Fork 212
Run git gc periodically on the crates.io index (#778) #956
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
Conversation
Co-authored-by: Chase Wilson <[email protected]>
Co-authored-by: Chase Wilson <[email protected]>
Co-authored-by: Chase Wilson <[email protected]>
Co-authored-by: Chase Wilson <[email protected]>
Co-authored-by: Chase Wilson <[email protected]>
… rails with "unused static"
src/utils/daemon.rs
Outdated
use std::time::{Duration, Instant}; | ||
|
||
fn run_git_gc() { | ||
let gc = Command::new("git").args(&["gc", "--auto"]).output(); |
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.
This needs the path to the repo to clean. I think it'd make most sense to move this to a method on index::Index
since that's what needs cleaning and has the path available. You can then access it via docbuilder.index
to call.
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.
@Nemo157 inside what method?
How about RustwideBuilder::build_package
? Doesn't it run in the same location as the git
repo of the crate?
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.
A new method, probably just keep this name for it run_git_gc
.
I have vague ideas of eventually removing the index to queue handling from docbuilder
completely, it isn't really related to building the docs.
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.
@Nemo157 what I meant was, where in the Index
flow to add it.
I checked now and the Index
is called from RustwideBuilder
which is called from the Queue
.
So maybe add last_gc_run
property on the Queue
and call run_git_gc
conditionally from inside build_package
? Something along these lines?
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.
I was thinking just keep calling it from here, this is the place that causes us to create new packfiles so should be responsible for knowing when to clean them up.
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.
@Nemo157 what is the location you refer to by calling it from here
?
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.
I assume he meant daemon.rs
. So fn run_git_gc
gets moved to Index
, but still gets called from start_registry_watcher
.
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.
… and CURRENTLY_RUNNING_THREADS declaration match the usage, "target_os = linux"
src/utils/daemon.rs
Outdated
use std::time::{Duration, Instant}; | ||
|
||
fn run_git_gc() { | ||
let gc = Command::new("git").args(&["gc", "--auto"]).output(); |
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.
I assume he meant daemon.rs
. So fn run_git_gc
gets moved to Index
, but still gets called from start_registry_watcher
.
@ohaddahan Could you push your commits so we can see the changes? |
Pre commit hook
@Kixiron ops sorry, forgot to merge my fork branch 😊 |
Co-authored-by: Chase Wilson <[email protected]>
Co-authored-by: Chase Wilson <[email protected]>
… rails with "unused static"
… and CURRENTLY_RUNNING_THREADS declaration match the usage, "target_os = linux"
Co-authored-by: Chase Wilson <[email protected]>
@ohaddahan Hi, your commits messages say 'rebase' but rebases do not have commits, they apply the original commits on top of the original branch. As it stands this has 143 commits and a 900 line diff. Can you please rebase using something like the following:
Since you have several merge commits there will be many conflicts, so you should drop all commits that are not related to this PR. Alternatively, it might be easier to start over on a new branch:
However, as-is, this is very difficult to review. |
If you want help feel free to join the discord channel: https://discord.gg/f7mTXPW |
@jyn514 yeah my fork went down the drain, I'll clean it up. |
Closing in favor of #975 |
Forking
git gc
periodically fromstart_registry_watcher
.Closes #778.