Kill MySQL query on user abort

后端 未结 6 1440
星月不相逢
星月不相逢 2020-12-05 03:30

When running a long query from PHP, [how] can I kill the query if the user presses stop in their browser?

Take into consideration that I cannot call

6条回答
  •  悲&欢浪女
    2020-12-05 03:58

    PHP, in most cases, won't know that a connection was closed (since the user aborted) until it tries to send something over the network and then receives a SIGPIPE. The only thing you can do is try working with timeouts aborting to long queries or killing them from another process.

提交回复
热议问题