mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Remove redundant check for already uploaded block in UploadBlock function.
This commit is contained in:
@@ -126,9 +126,6 @@ func UploadBlock(uid uint, fid uint, index int, data []byte) error {
|
||||
if index < 0 || index >= uploadingFile.BlocksCount() {
|
||||
return model.NewRequestError("block index is not correct")
|
||||
}
|
||||
if uploadingFile.Blocks[index] {
|
||||
return model.NewRequestError("block already uploaded")
|
||||
}
|
||||
|
||||
path := filepath.Join(uploadingFile.TempPath, strconv.Itoa(index))
|
||||
if err := os.WriteFile(path, data, os.ModePerm); err != nil {
|
||||
|
Reference in New Issue
Block a user