diff --git a/src/duplicacy_swiftstorage.go b/src/duplicacy_swiftstorage.go index 8ed7947b..f4dfcae8 100644 --- a/src/duplicacy_swiftstorage.go +++ b/src/duplicacy_swiftstorage.go @@ -108,9 +108,7 @@ func CreateSwiftStorage(storageURL string, key string, threads int) (storage *Sw arguments["protocol"] = "https" } - // This context ends up expired, which is fine. - ctx, cancel := context.WithDeadline(context.Background(), time.Now()) - defer cancel() + ctx, _ := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second) // Please refer to https://godoc.org/github.com/ncw/swift#Connection connection := swift.Connection{