Anonymous | Login | Signup for a new account | 2023-10-03 05:34 CDT | ![]() |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
View Revisions: Issue #1339 | [ All Revisions ] [ Back to Issue ] | ||
Summary | 0001339: Long running scheduled task delays page loading | ||
Revision | 2012-07-09 10:48:49 by alex | ||
Description | Administrator can set scheduled tasks to be executed: * in cron; * after page load. In later case long running scheduled task delays actual page content from being sent to user, who requested a page. To solve this we need to place following code after page content has been sent to user (but before scheduled task execution is started): ignore_user_abort(true); while ( ob_get_level() ) { ob_end_clean(); } header('Connection: close'); // header('Content-Length: 0'); // only uncomment when such header isn't sent already flush(); This code will do following: 1. web browser "Loading ..." indicator should show 100% 2. connection to webserver will be terminated 3. reset of the script will continue to execute on the server |
||
Revision | 2012-07-09 10:45:27 by alex | ||
Description | Administrator can set scheduled tasks to be executed: * in cron; * after page load. In later case long running scheduled task delays actual page content from being sent to user, who requested a page. |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Web Development by Intechnic![]() In-Portal Open Source CMS |