Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个很大的php/mysql应用程序,其中包含很多sql生成的查询,report报告完成后,它会发送一封带有报告链接的电子邮件。
php/mysql
sql
report
唯一的问题是,如果我离开了windows open报告generate fully,我会收到一封带有报告链接的电子邮件,但是当I close the browserWindows 时,该工具会生成half of the data并发送一封电子邮件。
windows open
generate fully
I close the browser
half of the data
主要是为什么关闭窗口只有一半的时间。
您可以使用 ignore_user_abort 和 set_time_limit 的组合:
ignore_user_abort(true); // continue to run after client disconnects set_time_limit(0); // infinite time limit
您可以估计脚本需要的秒数,而不是无限的时间限制,并为其添加更多时间。这样脚本就没有机会挂起进程。