-
Notifications
You must be signed in to change notification settings - Fork 369
Open
Description
文档中提到:
Wechat server timeout setting
Stability various even for Tencent wechat server, so setting a long timeout may needed, default is 20 seconds if not set.
通常来说,用户都会以为默认是请求超过 20 秒就会被判定为超时,并中断
但实际上:
# lib/wechat/http_client.rb line 9 in wechat.gem
# timeout = 20 by default
@httprb = HTTP.timeout(:global, write: timeout, connect: timeout, read: timeout)
# lib/http/timeout/global.rb in http.gem
def initialize(*args)
super
reset_counter
end
# To future me: Don't remove this again, past you was smarter.
def reset_counter
@time_left = connect_timeout + read_timeout + write_timeout
@total_timeout = time_left
end也就是说,实际允许的超时时间最大可能是设定值的 3 倍,即 60 秒.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels