File tree 2 files changed +23
-3
lines changed
2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
17
17
"go.uber.org/zap"
18
18
)
19
19
20
- const DefaultTimeout time.Duration = 5 * time .Second
20
+ const DefaultTimeout time.Duration = 10 * time .Second
21
21
22
22
// Master struct/object
23
23
type Client struct {
@@ -135,8 +135,6 @@ func (c *ClientConfig) Build() (*Client, error) {
135
135
)
136
136
}
137
137
138
-
139
-
140
138
client := & Client {
141
139
Integration : & c .Integration ,
142
140
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