File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
1717 "go.uber.org/zap"
1818)
1919
20- const DefaultTimeout time.Duration = 5 * time .Second
20+ const DefaultTimeout time.Duration = 10 * time .Second
2121
2222// Master struct/object
2323type Client struct {
@@ -135,8 +135,6 @@ func (c *ClientConfig) Build() (*Client, error) {
135135 )
136136 }
137137
138-
139-
140138 client := & Client {
141139 Integration : & c .Integration ,
142140 http : & httpClient ,
Original file line number Diff line number Diff line change 1+ package httpclient
2+
3+ import (
4+ "sync"
5+ "time"
6+ )
7+
8+ var mu sync.Mutex
9+
10+ // Amends 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+ }
16+
17+ // Resets HTTP timeout time back to 10 seconds
18+ func (c * Client ) ResetTimeout () {
19+ mu .Lock ()
20+ defer mu .Unlock ()
21+ c .http .Timeout = DefaultTimeout
22+ }
You can’t perform that action at this time.
0 commit comments