diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-09-22 16:23:38 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-09-22 16:23:38 +0200 |
commit | 34a60695b43713dfe82713cdc59fb6ca35ad4757 (patch) | |
tree | 4cd0c0e9661f60616d1c3c4de7fbd5091d56b4f9 /repo.go | |
parent | f3f0f3d451a667c7a12f23baf08853f12cbea4c0 (diff) | |
download | dna-backup-34a60695b43713dfe82713cdc59fb6ca35ad4757.tar.gz dna-backup-34a60695b43713dfe82713cdc59fb6ca35ad4757.zip |
misc log messages and refactoring
Diffstat (limited to 'repo.go')
-rw-r--r-- | repo.go | 26 |
1 files changed, 11 insertions, 15 deletions
@@ -151,14 +151,11 @@ func (r *Repo) Commit(source string) { files := listFiles(source) r.loadHashes(versions) r.loadFileLists(versions) - logger.Info(r.files) r.loadRecipes(versions) - logger.Info(r.recipe) go concatFiles(&files, writer) recipe := r.matchStream(reader, newVersion) r.storeFileList(newVersion, unprefixFiles(files, source)) r.storeRecipe(newVersion, recipe) - logger.Info(files) } func (r *Repo) Restore(destination string) { @@ -200,18 +197,17 @@ func (r *Repo) loadVersions() []string { func listFiles(path string) []File { var files []File - err := filepath.Walk(path, - func(p string, i fs.FileInfo, err error) error { - if err != nil { - logger.Warning(err) - return err - } - if i.IsDir() { - return nil - } - files = append(files, File{p, i.Size()}) + err := filepath.Walk(path, func(p string, i fs.FileInfo, err error) error { + if err != nil { + logger.Warning(err) + return err + } + if i.IsDir() { return nil - }) + } + files = append(files, File{p, i.Size()}) + return nil + }) if err != nil { logger.Error(err) } @@ -353,7 +349,7 @@ func (r *Repo) storageWorker(version int, storeQueue <-chan chunkData, end chan< if err != nil { logger.Error(err) } - logger.Info("stored", data.id) + // logger.Info("stored", data.id) } if err = file.Close(); err != nil { logger.Panic(err) |