In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

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.



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker