1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-09 00:00:02 +01:00

s3: Disable keepalive on minio HTTP client

This avoids connections being used for too long and being terminated by the
S3 endpoint.
This commit is contained in:
Rached Ben Mustapha 2016-02-04 23:10:15 +00:00
parent 7a8054d678
commit 3b065eeb7d

View file

@ -4,6 +4,7 @@ import (
"bytes"
"errors"
"io"
"net/http"
"strings"
"github.com/minio/minio-go"
@ -39,6 +40,11 @@ func Open(cfg Config) (backend.Backend, error) {
return nil, err
}
tr := &http.Transport{
DisableKeepAlives: true,
}
client.SetCustomTransport(tr)
be := &s3{client: client, bucketname: cfg.Bucket}
be.createConnections()