feat: update
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user