fzlee/alipay

希望支持timeout参数

Ehco1996 opened this issue · 7 comments

Is your feature request related to a problem? Please describe.
请求时发现写死了timeout是15s

Describe the solution you'd like
希望能支持timeout参数,另外发现直接用的是urllib库,想问一下为什么不用requests?

Additional context
附上一个sentry截图
截屏2020-09-06上午8 30 21

fzlee commented

主要是query_order的时候,服务起在国外的话,call阿里云的接口会经常timeout

fzlee commented

我感觉要是15s还没有返回,加大超时时间大概率也不会有结果。 你暂时试试直接修改我的源代码。超时时间延长,试试有没有效果,如果有的话,我再开放这个选项出来
On Sun, 6 Sep 2020 at 09:28, Ehco @.***> wrote: 主要是query_order的时候,服务起在国外的话,call阿里云的接口会经常timeout — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#114 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOYLNI7GL3VIBM5HBO7GL3SELQVBANCNFSM4Q3S4PAA . --
顺颂时祺 Fazheng Li

我是想调小timeout,这样可以多retry几次

fzlee commented
fzlee commented

试试2.1.1 吧

from alipay.utils import  AliPayConfig

config = AliPayConfig(timeout=5)
alipay = Alipay(... config=config)


感谢