We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前在Swoole\Http\Server中每个请求的最大执行时间没有限制,无法终止一些耗时的请求,只有靠上层Nginx配置proxy_read_timeout来间接地取消请求,但这样对客户端不够友好。
Swoole\Http\Server
Nginx
proxy_read_timeout
希望能增加配置项time_limit来限制每个请求的最大可执行时间(类似于set_time_limit),超时后能有个回调,来动态地给出超时的响应。
time_limit
$serv->set([ 'time_limit' => 30, // 每个请求的最大执行时间 30s,设置为0表示不限制 'time_limit_callback' => function(Swoole\Http\Request $request, Swoole\Http\Response $response, $timeLimit) { $response->end(sprintf('响应超时:%.1f秒', $timeLimit)); } ]);
The text was updated successfully, but these errors were encountered:
@matyhtf @twose 有可能支持吗?
Sorry, something went wrong.
有更新吗?
No branches or pull requests
背景
目前在
Swoole\Http\Server
中每个请求的最大执行时间没有限制,无法终止一些耗时的请求,只有靠上层Nginx
配置proxy_read_timeout
来间接地取消请求,但这样对客户端不够友好。提议
希望能增加配置项
time_limit
来限制每个请求的最大可执行时间(类似于set_time_limit),超时后能有个回调,来动态地给出超时的响应。The text was updated successfully, but these errors were encountered: