mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 11:44:45 -06:00
Incorporated PR feedback; call S3 for IsFastListing() #322
This commit is contained in:
@@ -32,6 +32,7 @@ type WasabiStorage struct {
|
|||||||
storageDir string
|
storageDir string
|
||||||
key string
|
key string
|
||||||
secret string
|
secret string
|
||||||
|
client *http.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
// See the Storage interface in duplicacy_storage.go for function
|
// See the Storage interface in duplicacy_storage.go for function
|
||||||
@@ -66,6 +67,7 @@ func CreateWasabiStorage(
|
|||||||
storageDir: storageDir,
|
storageDir: storageDir,
|
||||||
key: accessKey,
|
key: accessKey,
|
||||||
secret: secretKey,
|
secret: secretKey,
|
||||||
|
client: &http.Client{},
|
||||||
}
|
}
|
||||||
|
|
||||||
wasabi.DerivedStorage = wasabi
|
wasabi.DerivedStorage = wasabi
|
||||||
@@ -129,12 +131,11 @@ func (storage *WasabiStorage) MoveFile(
|
|||||||
request.Header.Add("Host", storage.endpoint)
|
request.Header.Add("Host", storage.endpoint)
|
||||||
request.Header.Add("Overwrite", "true")
|
request.Header.Add("Overwrite", "true")
|
||||||
|
|
||||||
client := &http.Client{}
|
response, error := storage.client.Do(request)
|
||||||
|
|
||||||
response, error := client.Do(request)
|
|
||||||
if error != nil {
|
if error != nil {
|
||||||
return error
|
return error
|
||||||
}
|
}
|
||||||
|
defer response.Body.Close()
|
||||||
|
|
||||||
if response.StatusCode != 200 {
|
if response.StatusCode != 200 {
|
||||||
return errors.New(response.Status)
|
return errors.New(response.Status)
|
||||||
@@ -182,7 +183,7 @@ func (storage *WasabiStorage) IsStrongConsistent() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (storage *WasabiStorage) IsFastListing() bool {
|
func (storage *WasabiStorage) IsFastListing() bool {
|
||||||
return true
|
return storage.s3.IsFastListing()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (storage *WasabiStorage) EnableTestMode() {
|
func (storage *WasabiStorage) EnableTestMode() {
|
||||||
|
|||||||
Reference in New Issue
Block a user