packages: skip error logging on duplicate
This commit is contained in:
parent
7b576d0a5d
commit
dda88488ca
1 changed files with 6 additions and 2 deletions
|
@ -165,11 +165,15 @@ func createPackageAndVersion(ctx context.Context, pvci *PackageCreationInfo, all
|
||||||
if pv, err = packages_model.GetOrInsertVersion(ctx, pv); err != nil {
|
if pv, err = packages_model.GetOrInsertVersion(ctx, pv); err != nil {
|
||||||
if err == packages_model.ErrDuplicatePackageVersion {
|
if err == packages_model.ErrDuplicatePackageVersion {
|
||||||
versionCreated = false
|
versionCreated = false
|
||||||
}
|
} else {
|
||||||
if err != packages_model.ErrDuplicatePackageVersion || !allowDuplicate {
|
|
||||||
log.Error("Error inserting package: %v", err)
|
log.Error("Error inserting package: %v", err)
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !allowDuplicate {
|
||||||
|
// no need to log an error
|
||||||
|
return nil, false, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if versionCreated {
|
if versionCreated {
|
||||||
|
|
Loading…
Reference in a new issue