-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
when using rules to delete packages, remove unclean bugs #34632
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
base: main
Are you sure you want to change the base?
Conversation
Please add some tests |
defer committer.Close() | ||
|
||
err = packages_model.IterateEnabledCleanupRules(ctx, func(ctx context.Context, pcr *packages_model.PackageCleanupRule) error { | ||
return packages_model.IterateEnabledCleanupRules(outerCtx, func(ctx context.Context, pcr *packages_model.PackageCleanupRule) error { |
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.
Why the db.TxContext
? outerCtx
seems to be a bug
count, err := sess.FindAndCount(&pvs) | ||
return pvs, count, err | ||
err := sess.Find(&pvs) | ||
return pvs, int64(len(pvs)), err |
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.
Why the behavior is changed? The root problem is how we should treat the "count": does it have a clear meaning like "the total count in database"?
By default, the code extracts 200 package versions. If too many packages are generated every day or if rule cleaning is enabled later, which means there are more than 200 versions corresponding to the library package, it may not be cleaned up completely, resulting in residue