From 8602ff0d0c37e0cd30afc46e5d044266ba6a19b4 Mon Sep 17 00:00:00 2001 From: yanghao05 Date: Sat, 29 Mar 2025 18:29:54 +0800 Subject: [PATCH] feat: limit file 50M --- backend/app/service/commands/compress.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/service/commands/compress.go b/backend/app/service/commands/compress.go index c2aeec7..c9d777a 100644 --- a/backend/app/service/commands/compress.go +++ b/backend/app/service/commands/compress.go @@ -245,13 +245,13 @@ func compressAudio(srcPath, dstPath string) error { // compress video func compressVideo(srcPath, dstPath string) error { - // if file size < 100M then copy + // if file size < 50M then copy fileInfo, err := os.Stat(srcPath) if err != nil { return errors.Wrapf(err, "failed to get file info: %s", srcPath) } - if fileInfo.Size() < 100*1024*1024 { // 100 MB - log.Infof("file size < 100M, copy file from %s to %s", srcPath, dstPath) + if fileInfo.Size() < 50*1024*1024 { // 50 MB + log.Infof("file size < 50M, copy file from %s to %s", srcPath, dstPath) return copyFile(srcPath, dstPath) }