1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-06 00:03:38 +00:00

DOn't cancel the context and use a sane deadline.

This commit is contained in:
Mark Feit
2021-12-17 10:09:36 -05:00
parent 590d3b1b5b
commit 4743c7ba0d

View File

@@ -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{