Run git gc periodically on the crates.io index (#778)#956
Run git gc periodically on the crates.io index (#778)#956ohaddahan wants to merge 143 commits intorust-lang:masterfrom ohaddahan:master
Conversation
Co-authored-by: Chase Wilson <buckshot1233@gmail.com>
Co-authored-by: Chase Wilson <buckshot1233@gmail.com>
Co-authored-by: Chase Wilson <buckshot1233@gmail.com>
Co-authored-by: Chase Wilson <buckshot1233@gmail.com>
Co-authored-by: Chase Wilson <buckshot1233@gmail.com>
… rails with "unused static"
| 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.
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.
@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.
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.
@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.
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.
@Nemo157 what is the location you refer to by calling it from here?
There was a problem hiding this comment.
I assume he meant daemon.rs. So fn run_git_gc gets moved to Index, but still gets called from start_registry_watcher.
… and CURRENTLY_RUNNING_THREADS declaration match the usage, "target_os = linux"
| 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.
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 <buckshot1233@gmail.com>
Co-authored-by: Chase Wilson <buckshot1233@gmail.com>
… rails with "unused static"
… and CURRENTLY_RUNNING_THREADS declaration match the usage, "target_os = linux"
Co-authored-by: Chase Wilson <buckshot1233@gmail.com>
|
@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 gcperiodically fromstart_registry_watcher.Closes #778.