Skip to content

Commit 4a4903e

Browse files
committed
add optional timeout parameter -t
For some uploads 10 seconds is not enough.
1 parent c3bb29c commit 4a4903e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var (
3737
useSsl = flag.String("ssl", "", "SSL flag")
3838
syncRet = flag.String("sync_exp", "", "sync expected return code in format code:string")
3939
hasDownloadFile = flag.Bool("d", false, "set to true to take advantage of downloadFile API")
40+
timeoutSeconds = flag.Int("t", 10, "Upload timeout")
4041
)
4142

4243
type Item struct {
@@ -53,7 +54,7 @@ func main() {
5354
}
5455

5556
var httpClient = &http.Client{
56-
Timeout: time.Second * 10,
57+
Timeout: time.Second * time.Duration(*timeoutSeconds),
5758
}
5859

5960
httpheader := "http://"

0 commit comments

Comments
 (0)