File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed
Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ type Client interface {
4646
4747type isClient interface {
4848 isClient ()
49+ SetRequestTimeout (timeout time.Duration )
4950 wrapHeartbeatRequest () * v2.HeartbeatRequest
5051 onRecoverOrphanedTransactionCommand (endpoints * v2.Endpoints , command * v2.RecoverOrphanedTransactionCommand ) error
5152 onVerifyMessageCommand (endpoints * v2.Endpoints , command * v2.VerifyMessageCommand ) error
Original file line number Diff line number Diff line change @@ -455,3 +455,8 @@ func (p *defaultProducer) onRecoverOrphanedTransactionCommand(endpoints *v2.Endp
455455func (p * defaultProducer ) onVerifyMessageCommand (endpoints * v2.Endpoints , command * v2.VerifyMessageCommand ) error {
456456 return nil
457457}
458+
459+ func (p * defaultProducer ) SetRequestTimeout (timeout time.Duration ) {
460+ p .cli .opts .timeout = timeout
461+ p .pSetting .requestTimeout = p .cli .opts .timeout
462+ }
Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ type defaultPushConsumer struct {
7070 consumptionErrorQuantity atomic.Int64
7171}
7272
73+ func (pc * defaultPushConsumer ) SetRequestTimeout (timeout time.Duration ) {
74+ pc .cli .opts .timeout = timeout
75+ pc .pcSettings .requestTimeout = pc .cli .opts .timeout
76+ }
77+
7378func (pc * defaultPushConsumer ) isOn () bool {
7479 return pc .cli .on .Load ()
7580}
Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ type defaultSimpleConsumer struct {
6161 subTopicRouteDataResultCache sync.Map
6262}
6363
64+ func (sc * defaultSimpleConsumer ) SetRequestTimeout (timeout time.Duration ) {
65+ sc .cli .opts .timeout = timeout
66+ sc .scSettings .requestTimeout = sc .cli .opts .timeout
67+ }
68+
6469func (sc * defaultSimpleConsumer ) isOn () bool {
6570 return sc .cli .on .Load ()
6671}
You can’t perform that action at this time.
0 commit comments