Skip to content

Commit

Permalink
add optional timeout parameter -t
Browse files Browse the repository at this point in the history
For some uploads 10 seconds is not enough.
  • Loading branch information
JAndrassy committed Jan 4, 2022
1 parent c3bb29c commit 4a4903e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var (
useSsl = flag.String("ssl", "", "SSL flag")
syncRet = flag.String("sync_exp", "", "sync expected return code in format code:string")
hasDownloadFile = flag.Bool("d", false, "set to true to take advantage of downloadFile API")
timeoutSeconds = flag.Int("t", 10, "Upload timeout")
)

type Item struct {
Expand All @@ -53,7 +54,7 @@ func main() {
}

var httpClient = &http.Client{
Timeout: time.Second * 10,
Timeout: time.Second * time.Duration(*timeoutSeconds),
}

httpheader := "http://"
Expand Down

0 comments on commit 4a4903e

Please # to comment.