diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-10-28 06:48:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-27 18:48:07 -0400 |
commit | a920fcfd91b1d77cee8bf1143334cba1582b8c5c (patch) | |
tree | 3481c056f5bc5bbcde9bdec7b55abd0374855580 /services | |
parent | d70af38447a759d4a935e315e18efa4dd625f655 (diff) | |
download | gitea-a920fcfd91b1d77cee8bf1143334cba1582b8c5c.tar.gz gitea-a920fcfd91b1d77cee8bf1143334cba1582b8c5c.zip |
Fix db engine (#32351)
Fix #32349
Diffstat (limited to 'services')
-rw-r--r-- | services/packages/cleanup/cleanup.go | 2 | ||||
-rw-r--r-- | services/packages/debian/repository.go | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/services/packages/cleanup/cleanup.go b/services/packages/cleanup/cleanup.go index 5d5120c6a0..d7c9355da5 100644 --- a/services/packages/cleanup/cleanup.go +++ b/services/packages/cleanup/cleanup.go @@ -22,7 +22,7 @@ import ( rpm_service "code.gitea.io/gitea/services/packages/rpm" ) -// Task method to execute cleanup rules and cleanup expired package data +// CleanupTask executes cleanup rules and cleanup expired package data func CleanupTask(ctx context.Context, olderThan time.Duration) error { if err := ExecuteCleanupRules(ctx); err != nil { return err diff --git a/services/packages/debian/repository.go b/services/packages/debian/repository.go index 611faa6ade..13e98a820e 100644 --- a/services/packages/debian/repository.go +++ b/services/packages/debian/repository.go @@ -206,7 +206,11 @@ func buildPackagesIndices(ctx context.Context, ownerID int64, repoVersion *packa w := io.MultiWriter(packagesContent, gzw, xzw) addSeparator := false - if err := debian_model.SearchPackages(ctx, opts, func(pfd *packages_model.PackageFileDescriptor) { + pfds, err := debian_model.SearchPackages(ctx, opts) + if err != nil { + return err + } + for _, pfd := range pfds { if addSeparator { fmt.Fprintln(w) } @@ -220,10 +224,7 @@ func buildPackagesIndices(ctx context.Context, ownerID int64, repoVersion *packa fmt.Fprintf(w, "SHA1: %s\n", pfd.Blob.HashSHA1) fmt.Fprintf(w, "SHA256: %s\n", pfd.Blob.HashSHA256) fmt.Fprintf(w, "SHA512: %s\n", pfd.Blob.HashSHA512) - }); err != nil { - return err } - gzw.Close() xzw.Close() |