mirror of https://github.com/restic/restic.git
s3: Correctly return token in Load
This commit is contained in:
parent
0bd40bae6e
commit
26c16b9fd3
|
@ -212,11 +212,22 @@ func (be *s3) Load(h restic.Handle, length int, offset int64) (io.ReadCloser, er
|
||||||
|
|
||||||
coreClient := minio.Core{be.client}
|
coreClient := minio.Core{be.client}
|
||||||
rd, _, err := coreClient.GetObject(be.bucketname, objName, headers)
|
rd, _, err := coreClient.GetObject(be.bucketname, objName, headers)
|
||||||
|
if err != nil {
|
||||||
// return token
|
// return token
|
||||||
be.connChan <- struct{}{}
|
be.connChan <- struct{}{}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
return rd, err
|
closeRd := wrapReader{
|
||||||
|
ReadCloser: rd,
|
||||||
|
f: func() {
|
||||||
|
debug.Log("Close()")
|
||||||
|
// return token
|
||||||
|
be.connChan <- struct{}{}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return closeRd, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stat returns information about a blob.
|
// Stat returns information about a blob.
|
||||||
|
|
Loading…
Reference in New Issue