Fix: user storage might be returned twice when canceling uploading request (#645)
This commit is contained in:
parent
7279be2924
commit
6486e8799b
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"sync"
|
||||||
|
|
||||||
model "github.com/cloudreve/Cloudreve/v3/models"
|
model "github.com/cloudreve/Cloudreve/v3/models"
|
||||||
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
|
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
|
||||||
|
@ -317,6 +318,7 @@ func FileUploadStream(c *gin.Context) {
|
||||||
fs.Use("AfterUploadFailed", filesystem.HookGiveBackCapacity)
|
fs.Use("AfterUploadFailed", filesystem.HookGiveBackCapacity)
|
||||||
|
|
||||||
// 执行上传
|
// 执行上传
|
||||||
|
ctx = context.WithValue(ctx, fsctx.ValidateCapacityOnceCtx, &sync.Once{})
|
||||||
uploadCtx := context.WithValue(ctx, fsctx.GinCtx, c)
|
uploadCtx := context.WithValue(ctx, fsctx.GinCtx, c)
|
||||||
err = fs.Upload(uploadCtx, fileData)
|
err = fs.Upload(uploadCtx, fileData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue