diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-09-23 12:15:49 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-09-23 12:15:49 +0200 |
commit | 2835b35221cb831c4836531204d96e3c5c2d4b13 (patch) | |
tree | 2309934ef6cd140e0ceba90fb9f1ca87bbfa614a | |
parent | c47d2184b2e6a1e7dbd139ca47bb3aebcfeb754f (diff) | |
download | dna-backup-2835b35221cb831c4836531204d96e3c5c2d4b13.tar.gz dna-backup-2835b35221cb831c4836531204d96e3c5c2d4b13.zip |
use repo wrappers for files and recipe
-rw-r--r-- | repo.go | 8 | ||||
-rw-r--r-- | testdata/repo_8k_zlib/00000/files | bin | 379 -> 275 bytes | |||
-rw-r--r-- | testdata/repo_8k_zlib/00000/recipe | bin | 6783 -> 2638 bytes |
3 files changed, 4 insertions, 4 deletions
@@ -346,11 +346,11 @@ func (r *Repo) storeFileList(version int, list []File) { dest := filepath.Join(r.path, fmt.Sprintf(versionFmt, version), filesName) delta := slice.Diff(fileList2slice(r.files), fileList2slice(list)) logger.Infof("files delta %s", delta.String()) - storeBasicStruct(dest, utils.NopWriteWrapper, delta) + storeBasicStruct(dest, r.chunkWriteWrapper, delta) } func (r *Repo) loadFileLists(versions []string) { - r.files = slice2fileList(r.loadDeltas(versions, utils.NopReadWrapper, filesName)) + r.files = slice2fileList(r.loadDeltas(versions, r.chunkReadWrapper, filesName)) } func (r *Repo) storageWorker(version int, storeQueue <-chan chunkData, end chan<- bool) { @@ -714,11 +714,11 @@ func (r *Repo) storeRecipe(version int, recipe []Chunk) { dest := filepath.Join(r.path, fmt.Sprintf(versionFmt, version), recipeName) delta := slice.Diff(recipe2slice(r.recipe), recipe2slice(recipe)) logger.Infof("recipe delta %s", delta.String()) - storeBasicStruct(dest, utils.NopWriteWrapper, delta) + storeBasicStruct(dest, r.chunkWriteWrapper, delta) } func (r *Repo) loadRecipes(versions []string) { - recipe := slice2recipe(r.loadDeltas(versions, utils.NopReadWrapper, recipeName)) + recipe := slice2recipe(r.loadDeltas(versions, r.chunkReadWrapper, recipeName)) for _, c := range recipe { if rc, isRepo := c.(RepoChunk); isRepo { rc.SetRepo(r) diff --git a/testdata/repo_8k_zlib/00000/files b/testdata/repo_8k_zlib/00000/files Binary files differindex 56431d4..70ca423 100644 --- a/testdata/repo_8k_zlib/00000/files +++ b/testdata/repo_8k_zlib/00000/files diff --git a/testdata/repo_8k_zlib/00000/recipe b/testdata/repo_8k_zlib/00000/recipe Binary files differindex 66bde3d..d8c788b 100644 --- a/testdata/repo_8k_zlib/00000/recipe +++ b/testdata/repo_8k_zlib/00000/recipe |