Skip to content

Commit

Permalink
DOn't cancel the context and use a sane deadline.
Browse files Browse the repository at this point in the history
  • Loading branch information
markfeit committed Dec 17, 2021
1 parent 590d3b1 commit 4743c7b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/duplicacy_swiftstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 4743c7b

Please sign in to comment.