mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 10:58:55 +00:00
backend: remove a few unnecessary debug logs
This commit is contained in:
parent
8e1e3844aa
commit
803640ba4b
@ -144,8 +144,6 @@ func (be *MemoryBackend) Remove(ctx context.Context, h restic.Handle) error {
|
|||||||
be.m.Lock()
|
be.m.Lock()
|
||||||
defer be.m.Unlock()
|
defer be.m.Unlock()
|
||||||
|
|
||||||
debug.Log("Remove %v", h)
|
|
||||||
|
|
||||||
h.ContainedBlobType = restic.InvalidBlob
|
h.ContainedBlobType = restic.InvalidBlob
|
||||||
if _, ok := be.data[h]; !ok {
|
if _, ok := be.data[h]; !ok {
|
||||||
return errNotFound
|
return errNotFound
|
||||||
|
@ -207,7 +207,6 @@ func (b *Backend) openReader(ctx context.Context, h restic.Handle, length int, o
|
|||||||
}
|
}
|
||||||
req.Header.Set("Range", byteRange)
|
req.Header.Set("Range", byteRange)
|
||||||
req.Header.Set("Accept", ContentTypeV2)
|
req.Header.Set("Accept", ContentTypeV2)
|
||||||
debug.Log("Load(%v) send range %v", h, byteRange)
|
|
||||||
|
|
||||||
resp, err := b.client.Do(req)
|
resp, err := b.client.Do(req)
|
||||||
|
|
||||||
|
@ -271,7 +271,6 @@ func (be *Backend) Save(ctx context.Context, h restic.Handle, rd restic.RewindRe
|
|||||||
// only use multipart uploads for very large files
|
// only use multipart uploads for very large files
|
||||||
opts.PartSize = 200 * 1024 * 1024
|
opts.PartSize = 200 * 1024 * 1024
|
||||||
|
|
||||||
debug.Log("PutObject(%v, %v, %v)", be.cfg.Bucket, objName, rd.Length())
|
|
||||||
info, err := be.client.PutObject(ctx, be.cfg.Bucket, objName, io.NopCloser(rd), int64(rd.Length()), opts)
|
info, err := be.client.PutObject(ctx, be.cfg.Bucket, objName, io.NopCloser(rd), int64(rd.Length()), opts)
|
||||||
|
|
||||||
// sanity check
|
// sanity check
|
||||||
@ -297,10 +296,8 @@ func (be *Backend) openReader(ctx context.Context, h restic.Handle, length int,
|
|||||||
|
|
||||||
var err error
|
var err error
|
||||||
if length > 0 {
|
if length > 0 {
|
||||||
debug.Log("range: %v-%v", offset, offset+int64(length)-1)
|
|
||||||
err = opts.SetRange(offset, offset+int64(length)-1)
|
err = opts.SetRange(offset, offset+int64(length)-1)
|
||||||
} else if offset > 0 {
|
} else if offset > 0 {
|
||||||
debug.Log("range: %v-", offset)
|
|
||||||
err = opts.SetRange(offset, 0)
|
err = opts.SetRange(offset, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,10 +146,6 @@ func (be *beSwift) openReader(ctx context.Context, h restic.Handle, length int,
|
|||||||
headers["Range"] = fmt.Sprintf("bytes=%d-%d", offset, offset+int64(length)-1)
|
headers["Range"] = fmt.Sprintf("bytes=%d-%d", offset, offset+int64(length)-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := headers["Range"]; ok {
|
|
||||||
debug.Log("Load(%v) send range %v", h, headers["Range"])
|
|
||||||
}
|
|
||||||
|
|
||||||
obj, _, err := be.conn.ObjectOpen(ctx, be.container, objName, false, headers)
|
obj, _, err := be.conn.ObjectOpen(ctx, be.container, objName, false, headers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "conn.ObjectOpen")
|
return nil, errors.Wrap(err, "conn.ObjectOpen")
|
||||||
@ -163,7 +159,6 @@ func (be *beSwift) Save(ctx context.Context, h restic.Handle, rd restic.RewindRe
|
|||||||
objName := be.Filename(h)
|
objName := be.Filename(h)
|
||||||
encoding := "binary/octet-stream"
|
encoding := "binary/octet-stream"
|
||||||
|
|
||||||
debug.Log("PutObject(%v, %v, %v)", be.container, objName, encoding)
|
|
||||||
hdr := swift.Headers{"Content-Length": strconv.FormatInt(rd.Length(), 10)}
|
hdr := swift.Headers{"Content-Length": strconv.FormatInt(rd.Length(), 10)}
|
||||||
_, err := be.conn.ObjectPut(ctx,
|
_, err := be.conn.ObjectPut(ctx,
|
||||||
be.container, objName, rd, true, hex.EncodeToString(rd.Hash()),
|
be.container, objName, rd, true, hex.EncodeToString(rd.Hash()),
|
||||||
|
Loading…
Reference in New Issue
Block a user