From 2f2470220d8ecf9b62a6cdcf6d5153906c49de35 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Mon, 22 Feb 2021 00:20:55 -0500 Subject: [PATCH] Update upload.go --- upload.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/upload.go b/upload.go index e24a8b7..78672c5 100644 --- a/upload.go +++ b/upload.go @@ -320,15 +320,16 @@ func processUpload(upReq UploadRequest) (upload Upload, err error) { // Get the rest of the metadata needed for storage var fileExpiry time.Time + maxDurationTime := time.Duration(Config.maxDurationTime) if upReq.expiry == 0 { - if upReq.size > Config.maxDurationSize && Config.maxDurationTime > 0 { - fileExpiry = time.Now().Add(Config.maxDurationTime) + if upReq.size > Config.maxDurationSize && maxDurationTime > 0 { + fileExpiry = time.Now().Add(maxDurationTime) } else { fileExpiry = expiry.NeverExpire } } else { - if upReq.size > Config.maxDurationSize && upReq.expiry > Config.maxDurationTime { - fileExpiry = time.Now().Add(Config.maxDurationTime) + if upReq.size > Config.maxDurationSize && upReq.expiry > CmaxDurationTime { + fileExpiry = time.Now().Add(maxDurationTime) } else { fileExpiry = time.Now().Add(upReq.expiry) }