Rename getUUID() into mustGetUUID() (#3320)

In case of UUID generation failure mustGetUUID() will panic than
infinitely trying in for loop.
This commit is contained in:
Bala FA
2016-11-22 16:52:37 -08:00
committed by Harshavardhana
parent 71b357e4f2
commit 1d4ac4b084
11 changed files with 36 additions and 41 deletions

View File

@@ -236,7 +236,7 @@ func (fs fsObjects) newMultipartUpload(bucket string, object string, meta map[st
objectMPartPathLock.Lock()
defer objectMPartPathLock.Unlock()
uploadID = getUUID()
uploadID = mustGetUUID()
initiated := time.Now().UTC()
// Add upload ID to uploads.json
if err = fs.addUploadID(bucket, object, uploadID, initiated); err != nil {
@@ -319,7 +319,7 @@ func (fs fsObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
}
partSuffix := fmt.Sprintf("object%d", partID)
tmpPartPath := uploadID + "." + getUUID() + "." + partSuffix
tmpPartPath := uploadID + "." + mustGetUUID() + "." + partSuffix
// Initialize md5 writer.
md5Writer := md5.New()