Skip to content

Commit

Permalink
changed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JarcauCristian committed Apr 16, 2024
1 parent 1479364 commit 5267885
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN go mod download

COPY configs ./configs

RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc -o mc
RUN curl https://dl.min.io/client/mc/release/linux-arm64/mc -o mc

RUN chmod +x ./mc

Expand Down
12 changes: 8 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,16 +483,20 @@ func main() {

reader := bytes.NewReader(buf.Bytes())

result, err := minio.uploadFile(reader, mapTags, float64(fileSize), fileName, contentType, boolTemporary)
results, err := minio.uploadFile(reader, mapTags, float64(fileSize), fileName, contentType, boolTemporary)

if err != nil {
c.JSON(500, gin.H{
"message": "Something happened when trying to upload the file!",
})
} else {
c.JSON(201, gin.H{
"message": result,
})
if len(results) == 0 {
c.JSON(404, gin.H{
"message": "Could not upload the file in any of the instances!",
})
} else {
c.JSON(201, results)
}
}
}
}
Expand Down

0 comments on commit 5267885

Please sign in to comment.