feat: save db every times

This commit is contained in:
yanghao05
2025-03-29 18:33:23 +08:00
parent 8602ff0d0c
commit 5770f3a425

View File

@@ -86,7 +86,6 @@ func commandCompress(dir string) error {
if err := readDB(dir); err != nil {
return errors.Wrap(err, "failed to read db")
}
defer writeDB(dir)
dirFiles, err := os.ReadDir(dir)
if err != nil {
@@ -123,6 +122,7 @@ func commandCompress(dir string) error {
}
compressed = append(compressed, compressedDB{Name: fileName, Md5: fileMd5})
writeDB(dir)
log.Infof("file %s compressed", fileName)
}