forked from TrueCloudLab/restic
MemBackend: Add Delete() and more debug
This commit is contained in:
parent
26697a0223
commit
4f6bc754b8
1 changed files with 9 additions and 1 deletions
|
@ -57,6 +57,14 @@ func NewMemoryBackend() *MemoryBackend {
|
|||
return memList(be, t, done)
|
||||
}
|
||||
|
||||
be.MockBackend.DeleteFn = func() error {
|
||||
be.m.Lock()
|
||||
defer be.m.Unlock()
|
||||
|
||||
be.data = make(memMap)
|
||||
return nil
|
||||
}
|
||||
|
||||
debug.Log("MemoryBackend.New", "created new memory backend")
|
||||
|
||||
return be
|
||||
|
@ -107,7 +115,7 @@ func (e *tempMemEntry) Finalize(t Type, name string) error {
|
|||
name = ""
|
||||
}
|
||||
|
||||
debug.Log("MemoryBackend", "save blob %p as %v %v", e, t, name)
|
||||
debug.Log("MemoryBackend", "save blob %p (%d bytes) as %v %v", e, len(e.data.Bytes()), t, name)
|
||||
return e.be.insert(t, name, e.data.Bytes())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue