mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-25 11:16:11 +01:00
packages: skip error logging on duplicate
This commit is contained in:
parent
7b576d0a5d
commit
dda88488ca
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue