go-zero
go-zero copied to clipboard
timeout changed after passing api context to rpc
api代码
api context传递

rpc context打印

api结果

rpc结果

你当前的context的超时时间只会对当前服务有影响,你在rpc中看到的context的超时时间RpcServerConf中的超时时间,看你的截图猜测应该就是默认的配置的2000ms
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
The timeout time of your current context will only affect the current service. The timeout time of the context you see in the rpc is the timeout time in RpcServerConf. According to your screenshot, it should be the default configuration of 2000ms.
当我配置文件修改了后
依然是没起效果,我的操作问题吗?
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
When my configuration file is modified
Still no effect, is there something wrong with my operation?
Please put Timeout After ListenOn, like this

timeOut这个值都能拿到但是我的超时还是2s
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
The value of timeOut can be obtained but my timeout is still 2s
遇到同样的超时设置不生效问题,希望得到回答解决,谢谢
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
I encountered the same problem that the timeout setting does not take effect, I hope to get an answer and solve it, thank you
you need to set timeout in both client and server sides.
遇到同样的问题,我在RPC 端设置的超时时间是 5s, 假如我不通过 API 调用,而是通过 RPC 其他工具调用,超时的配置是生效的,但是我用 API 调用,超时时间就变成了默认的两秒。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Encountered the same problem, the timeout period I set on the RPC side is 5s, if I do not call through the API, but through other RPC tools, the timeout configuration is effective, but if I use the API call, the timeout period becomes The default of two seconds.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.