Skip to content

Commit

Permalink
Remember whether bulk delete is supported after first call to QueryInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce authored and cezarsa committed Aug 18, 2016
1 parent 69ac013 commit ec8e2cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion largeobjects.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (c *Connection) LargeObjectDelete(container string, path string) error {
}
objects = append(objects, info)

if false && len(objects) > 0 {
if c.BulkDeleteSupport && len(objects) > 0 {
filenames := make([]string, len(objects))
for i, obj := range objects {
filenames[i] = obj.Name
Expand Down
3 changes: 3 additions & 0 deletions swift.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ type Connection struct {
TenantDomainId string // Id of the tenant's domain (v3 auth only), only needed if it differs the from user domain
TrustId string // Id of the trust (v3 auth only)
Transport http.RoundTripper `json:"-" xml:"-"` // Optional specialised http.Transport (eg. for Google Appengine)
// BulkDeleteSupport is filled after QueryInfo is called
BulkDeleteSupport bool
// These are filled in after Authenticate is called as are the defaults for above
StorageUrl string
AuthToken string
Expand Down Expand Up @@ -429,6 +431,7 @@ func (c *Connection) QueryInfo() (infos SwiftInfo, err error) {
err = readJson(resp, &infos)
return infos, err
}
_, c.BulkDeleteSupport = infos["bulk_delete"]
return nil, err
}

Expand Down

0 comments on commit ec8e2cf

Please sign in to comment.