forked from TrueCloudLab/restic
Remove Repository.Test()
This commit is contained in:
parent
6e38a8a033
commit
eb6dfcf58c
4 changed files with 4 additions and 8 deletions
|
@ -254,7 +254,7 @@ func (arch *Archiver) fileWorker(wg *sync.WaitGroup, p *Progress, done <-chan st
|
||||||
// check if all content is still available in the repository
|
// check if all content is still available in the repository
|
||||||
contentMissing := false
|
contentMissing := false
|
||||||
for _, blob := range oldNode.blobs {
|
for _, blob := range oldNode.blobs {
|
||||||
if ok, err := arch.repo.Test(backend.Data, blob.Storage.String()); !ok || err != nil {
|
if ok, err := arch.repo.Backend().Test(backend.Data, blob.Storage.String()); !ok || err != nil {
|
||||||
debug.Log("Archiver.fileWorker", " %v not using old data, %v (%v) is missing", e.Path(), blob.ID.Str(), blob.Storage.Str())
|
debug.Log("Archiver.fileWorker", " %v not using old data, %v (%v) is missing", e.Path(), blob.ID.Str(), blob.Storage.Str())
|
||||||
contentMissing = true
|
contentMissing = true
|
||||||
break
|
break
|
||||||
|
|
2
cache.go
2
cache.go
|
@ -115,7 +115,7 @@ func (c *Cache) Clear(repo *repository.Repository) error {
|
||||||
for _, entry := range list {
|
for _, entry := range list {
|
||||||
debug.Log("Cache.Clear", "found entry %v", entry)
|
debug.Log("Cache.Clear", "found entry %v", entry)
|
||||||
|
|
||||||
if ok, err := repo.Test(backend.Snapshot, entry.ID.String()); !ok || err != nil {
|
if ok, err := repo.Backend().Test(backend.Snapshot, entry.ID.String()); !ok || err != nil {
|
||||||
debug.Log("Cache.Clear", "snapshot %v doesn't exist any more, removing %v", entry.ID, entry)
|
debug.Log("Cache.Clear", "snapshot %v doesn't exist any more, removing %v", entry.ID, entry)
|
||||||
|
|
||||||
err = c.purge(backend.Snapshot, entry.Subtype, entry.ID)
|
err = c.purge(backend.Snapshot, entry.Subtype, entry.ID)
|
||||||
|
|
|
@ -58,7 +58,7 @@ func fsckFile(opts CmdFsck, repo *repository.Repository, IDs []backend.ID) (uint
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// test if data blob is there
|
// test if data blob is there
|
||||||
ok, err := repo.Test(backend.Data, packID.String())
|
ok, err := repo.Backend().Test(backend.Data, packID.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -580,7 +580,7 @@ func (s *Repository) SearchKey(password string) error {
|
||||||
// Init creates a new master key with the supplied password and initializes the
|
// Init creates a new master key with the supplied password and initializes the
|
||||||
// repository config.
|
// repository config.
|
||||||
func (s *Repository) Init(password string) error {
|
func (s *Repository) Init(password string) error {
|
||||||
has, err := s.Test(backend.Config, "")
|
has, err := s.be.Test(backend.Config, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -676,10 +676,6 @@ func (s *Repository) List(t backend.Type, done <-chan struct{}) <-chan backend.I
|
||||||
return outCh
|
return outCh
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Repository) Test(t backend.Type, name string) (bool, error) {
|
|
||||||
return s.be.Test(t, name)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *Repository) Remove(t backend.Type, name string) error {
|
func (s *Repository) Remove(t backend.Type, name string) error {
|
||||||
return s.be.Remove(t, name)
|
return s.be.Remove(t, name)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue