Update upload.go
This commit is contained in:
parent
605773decc
commit
2f2470220d
|
@ -320,15 +320,16 @@ func processUpload(upReq UploadRequest) (upload Upload, err error) {
|
||||||
|
|
||||||
// Get the rest of the metadata needed for storage
|
// Get the rest of the metadata needed for storage
|
||||||
var fileExpiry time.Time
|
var fileExpiry time.Time
|
||||||
|
maxDurationTime := time.Duration(Config.maxDurationTime)
|
||||||
if upReq.expiry == 0 {
|
if upReq.expiry == 0 {
|
||||||
if upReq.size > Config.maxDurationSize && Config.maxDurationTime > 0 {
|
if upReq.size > Config.maxDurationSize && maxDurationTime > 0 {
|
||||||
fileExpiry = time.Now().Add(Config.maxDurationTime)
|
fileExpiry = time.Now().Add(maxDurationTime)
|
||||||
} else {
|
} else {
|
||||||
fileExpiry = expiry.NeverExpire
|
fileExpiry = expiry.NeverExpire
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if upReq.size > Config.maxDurationSize && upReq.expiry > Config.maxDurationTime {
|
if upReq.size > Config.maxDurationSize && upReq.expiry > CmaxDurationTime {
|
||||||
fileExpiry = time.Now().Add(Config.maxDurationTime)
|
fileExpiry = time.Now().Add(maxDurationTime)
|
||||||
} else {
|
} else {
|
||||||
fileExpiry = time.Now().Add(upReq.expiry)
|
fileExpiry = time.Now().Add(upReq.expiry)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue