diff options
author | oliverpool <git@olivier.pfad.fr> | 2024-03-19 16:17:24 +0100 |
---|---|---|
committer | oliverpool <git@olivier.pfad.fr> | 2024-03-24 07:12:31 +0100 |
commit | dda88488ca3eca76510c95683035c28f1c10bff6 (patch) | |
tree | 097232b0a5f9e681005f8acaf3e8ce5b442645c4 | |
parent | activitypub: warn instead of error (diff) | |
download | forgejo-dda88488ca3eca76510c95683035c28f1c10bff6.tar.xz forgejo-dda88488ca3eca76510c95683035c28f1c10bff6.zip |
packages: skip error logging on duplicate
-rw-r--r-- | services/packages/packages.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/packages/packages.go b/services/packages/packages.go index 64b1ddd869..8f688a74f4 100644 --- a/services/packages/packages.go +++ b/services/packages/packages.go @@ -165,11 +165,15 @@ func createPackageAndVersion(ctx context.Context, pvci *PackageCreationInfo, all if pv, err = packages_model.GetOrInsertVersion(ctx, pv); err != nil { if err == packages_model.ErrDuplicatePackageVersion { versionCreated = false - } - if err != packages_model.ErrDuplicatePackageVersion || !allowDuplicate { + } else { log.Error("Error inserting package: %v", err) return nil, false, err } + + if !allowDuplicate { + // no need to log an error + return nil, false, err + } } if versionCreated { |