Skip to content

Commit f957be7

Browse files
committed
added timeout changer to http client
1 parent 99f092e commit f957be7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

httpclient/timeouts.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package httpclient
2+
3+
import (
4+
"sync"
5+
"time"
6+
)
7+
8+
var mu sync.Mutex
9+
10+
// Modifies the HTTP timeout time
11+
func (c *Client) ModifyHttpTimeout(newTimeout time.Duration) {
12+
mu.Lock()
13+
defer mu.Unlock()
14+
c.http.Timeout = newTimeout
15+
}

0 commit comments

Comments
 (0)