fix(fs): fd must be closed after deleting, renaming
This commit is contained in:
parent
ccfb9deb7e
commit
dc80778255
3 changed files with 82 additions and 7 deletions
|
@ -157,6 +157,7 @@ func (h *FileHandlers) Create(c *gin.Context) {
|
|||
|
||||
err = h.deps.FS().Create(tmpFilePath)
|
||||
if err != nil {
|
||||
fmt.Println("\nexist,", err, tmpFilePath)
|
||||
if os.IsExist(err) {
|
||||
// avoid adding file size more than once
|
||||
err = h.deps.Users().SetUsed(userIDInt, false, req.FileSize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue