swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.42k stars 3.16k forks source link

http协议服务器,怎么设置请求超时呢? #5459

Closed lushaobo closed 1 month ago

lushaobo commented 1 month ago

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

类似于 php-fpm 的 max_execution_time 配置,能够控制请求的时间

  1. What did you expect to see?

  2. What did you see instead?

  3. What version of Swoole are you using (show your php --ri swoole)?

  4. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

matyhtf commented 1 month ago

没有类似的设置,建议增加一个定时器,在超时后执行 Response::end() ,但无法终止正在执行的 onRequest 任务

lushaobo commented 1 month ago

好的,多谢。