File tree 3 files changed +3
-12
lines changed
3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -203,10 +203,7 @@ func (this *CGrpcServer) UpdateHandlerTimeout(htcs map[string]time.Duration) {
203
203
204
204
func (this * CGrpcServer ) getHandlerTimeout (path string ) time.Duration {
205
205
handlerTimeout := * (* map [string ]time.Duration )(atomic .LoadPointer ((* unsafe .Pointer )(unsafe .Pointer (& this .handlerTimeout ))))
206
- if t , ok := handlerTimeout [path ]; ok {
207
- if this .c .GlobalTimeout <= t {
208
- return this .c .GlobalTimeout
209
- }
206
+ if t , ok := handlerTimeout [path ]; ok && (this .c .GlobalTimeout == 0 || t < this .c .GlobalTimeout ) {
210
207
return t
211
208
}
212
209
return this .c .GlobalTimeout
Original file line number Diff line number Diff line change @@ -211,10 +211,7 @@ func (this *CrpcServer) UpdateHandlerTimeout(htcs map[string]time.Duration) {
211
211
212
212
func (this * CrpcServer ) getHandlerTimeout (path string ) time.Duration {
213
213
handlerTimeout := * (* map [string ]time.Duration )(atomic .LoadPointer ((* unsafe .Pointer )(unsafe .Pointer (& this .handlerTimeout ))))
214
- if t , ok := handlerTimeout [path ]; ok {
215
- if this .c .GlobalTimeout <= t {
216
- return this .c .GlobalTimeout
217
- }
214
+ if t , ok := handlerTimeout [path ]; ok && (this .c .GlobalTimeout == 0 || t < this .c .GlobalTimeout ) {
218
215
return t
219
216
}
220
217
return this .c .GlobalTimeout
Original file line number Diff line number Diff line change @@ -369,10 +369,7 @@ func (this *WebServer) UpdateHandlerTimeout(htcs map[string]map[string]time.Dura
369
369
func (this * WebServer ) getHandlerTimeout (method , path string ) time.Duration {
370
370
handlerTimeout := * (* map [string ]map [string ]time.Duration )(atomic .LoadPointer ((* unsafe .Pointer )(unsafe .Pointer (& this .handlerTimeout ))))
371
371
if m , ok := handlerTimeout [method ]; ok {
372
- if t , ok := m [path ]; ok {
373
- if this .c .GlobalTimeout <= t {
374
- return this .c .GlobalTimeout
375
- }
372
+ if t , ok := m [path ]; ok && (this .c .GlobalTimeout == 0 || t < this .c .GlobalTimeout ) {
376
373
return t
377
374
}
378
375
}
You can’t perform that action at this time.
0 commit comments