From 50ac4f816a0b5b230dca6da729025024c93301a0 Mon Sep 17 00:00:00 2001 From: yanghao05 Date: Sat, 29 Mar 2025 18:08:06 +0800 Subject: [PATCH] feat: update --- backend/app/service/commands/compress.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/app/service/commands/compress.go b/backend/app/service/commands/compress.go index 70a5e3a..7312365 100644 --- a/backend/app/service/commands/compress.go +++ b/backend/app/service/commands/compress.go @@ -55,10 +55,16 @@ func Serve(cmd *cobra.Command, args []string) error { if len(args) == 0 { return errors.New("usage: compress path") } + log.Infof("start compressing %s", args[0]) + + if err := commandCompress(args[0]); err != nil { + log.WithError(err).Errorf("compressing %s failed", args[0]) + return err + } ticker := time.NewTicker(5 * time.Minute) for range ticker.C { - log.Infof("compressing %s", args[0]) + log.Infof("start compressing %s", args[0]) if err := commandCompress(args[0]); err != nil { log.WithError(err).Errorf("compressing %s failed", args[0]) @@ -93,6 +99,8 @@ func commandCompress(dir string) error { continue } + log.Infof("process file %s", file.Name()) + // get the file name fileName := file.Name() filePath := filepath.Join(dir, fileName)