2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-02 11:46:36 +00:00

s3: Reorder debug messages

This way the semaphore token acquisition can be observed in the debug
log.
This commit is contained in:
Alexander Neumann 2017-06-11 14:30:56 +02:00
parent 907c201693
commit 73b296918b

View File

@ -174,8 +174,8 @@ func (be *Backend) Save(ctx context.Context, h restic.Handle, rd io.Reader) (err
return errors.New("key already exists")
}
debug.Log("PutObject(%v, %v)", be.bucketname, objName)
be.sem.GetToken()
debug.Log("PutObject(%v, %v)", be.bucketname, objName)
n, err := be.client.PutObject(be.bucketname, objName, rd, "application/octet-stream")
be.sem.ReleaseToken()
@ -215,14 +215,14 @@ func (be *Backend) Load(ctx context.Context, h restic.Handle, length int, offset
objName := be.Filename(h)
be.sem.GetToken()
byteRange := fmt.Sprintf("bytes=%d-", offset)
if length > 0 {
byteRange = fmt.Sprintf("bytes=%d-%d", offset, offset+int64(length)-1)
}
headers := minio.NewGetReqHeaders()
headers.Add("Range", byteRange)
be.sem.GetToken()
debug.Log("Load(%v) send range %v", h, byteRange)
coreClient := minio.Core{Client: be.client}