-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Make admin git gc tasks run in background #10629
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
b727957
to
334df6a
Compare
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 couple of comments, just in case they're relevant
Now should we be putting a system notice to say that we've completed the gc/fsck? |
None of the other tasks seem to do this. So perhaps it would be better to do it as another PR |
@zeripath I would like to create a record on task table with a new type and track the status of them. |
You could leverage the process table - there's nothing that requires that to be an actual running external process |
I'd go for it. Given that it can only be started manually, a notice would not be unexpected. |
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 think we should use a unique queue to keep only one gc once for a repository.
We can just run it with |
Tried this locally, UI showed GC was started but in the log I see this error (no stack or anything):
Any way to show more error detail? |
Codecov Report
@@ Coverage Diff @@
## master #10629 +/- ##
=========================================
Coverage ? 43.61%
=========================================
Files ? 588
Lines ? 82502
Branches ? 0
=========================================
Hits ? 35980
Misses ? 42060
Partials ? 4462
Continue to review full report at Codecov.
|
@silverwind There was a bug in the previous version try now |
@@ -72,13 +72,18 @@ func GitGcRepos(ctx context.Context) error { | |||
if err := repo.GetOwner(); err != nil { | |||
return err | |||
} | |||
log.Trace("Running git gc on %v", repo) |
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.
What logging config do I need to see these? I have LEVEL = Trace
and tried both file/stdout logging. Also, I'd suggest raising this and similar ones to Info
.
OK. We have two options - keep this a simple just background the GC tasks PR - or properly sort out these admin and cron tasks. That is:
As an extension cron tasks need restructuring - they should probably be merged with the admin tasks - and their config moved to the db? |
Yes, please. I don't feel like one should have to dig into logs for this. I'd say also report when admin actions start in the system notices. Additional "nicities" I could see:
|
I'm going to close this in favour of an all singing all dancing refactor... |
See #10745 |
How is the status here? My hope was to get this in 1.12.0. |
The admin git gc and git fsck tasks should run in the background rather than run on the request scope.
Any errors should then be put in to the notices.
Fix #10299