-
Notifications
You must be signed in to change notification settings - Fork 340
feat: add the API for trigger the GC manually #4074
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
Signed-off-by: chlins <chlins.zhang@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4074 +/- ##
==========================================
- Coverage 33.25% 33.18% -0.08%
==========================================
Files 346 346
Lines 40493 40581 +88
==========================================
Hits 13466 13466
- Misses 26134 26222 +88
Partials 893 893
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
LGTM
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.
LGTM
This pull request introduces a new Garbage Collection (GC) job functionality to the system, including its creation, execution, and management. The changes span across multiple files and involve updates to constants, context handling, service interfaces, and job creation logic. Below is a summary of the most important changes:
New GC Job Functionality:
GCJob
to represent the GC job type ininternal/job/constants.go
.CreateGCJob
method in theservice
layer to handle the creation of GC jobs. This includes asynchronous execution and polling for job completion. [1] [2]CreateGCJobRequest
type inmanager/types/job.go
to define the structure for GC job creation requests.Context Enhancements:
ContextKeyUserID
andContextKeyTaskID
inpkg/gc/gc.go
to manage user and task IDs in the context, enabling better tracking of GC jobs.recorder.Init
methods inmanager/gc/audit.go
andmanager/gc/job.go
to include user and task IDs from the context. [1] [2]Service and Job Management Updates:
Service
interface inmanager/service/service.go
to include the newCreateGCJob
method.service
struct to include agc
field for managing GC tasks, and updated its initialization in theNew
function. [1] [2]CreateGCJob
inmanager/service/mocks/service_mock.go
for testing purposes.Miscellaneous Changes:
manager/manager.go
file to properly initialize and register GC tasks using the newmanagergc
package alias. [1] [2]jobRecorder.Init
method to support the new GC job type by including theUserID
field.Description
Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist