fix: if we have an existing upload, just return it as if successful
This commit is contained in:
parent
ed6220fc7d
commit
90170e5b81
|
@ -58,6 +58,11 @@ func Upload(r io.ReadSeeker, size int64, hash []byte) (model.Upload, error) {
|
|||
shared.GetLogger().Error("Failed to query uploads table", zap.Error(err))
|
||||
return upload, err
|
||||
}
|
||||
|
||||
if result.RowsAffected > 0 && upload.ID > 0 {
|
||||
shared.GetLogger().Info("Upload already exists")
|
||||
return upload, nil
|
||||
}
|
||||
}
|
||||
|
||||
objectExistsResult, err := client.R().Get(fmt.Sprintf("/worker/objects/%s", hashHex))
|
||||
|
|
Loading…
Reference in New Issue