Created
July 26, 2016 19:47
-
-
Save dng-dev/457e7306e06f528c175e7183de9b5889 to your computer and use it in GitHub Desktop.
implementation for fastcgi_finish_request in Magento
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/code/core/Mage/Core/Controller/Varien/Front.php b/app/code/core/Mage/Core/Controller/Varien/Front.php | |
index 75d0e17..890ba9d 100755 | |
--- a/app/code/core/Mage/Core/Controller/Varien/Front.php | |
+++ b/app/code/core/Mage/Core/Controller/Varien/Front.php | |
@@ -182,6 +182,12 @@ class Mage_Core_Controller_Varien_Front extends Varien_Object | |
Mage::dispatchEvent('controller_front_send_response_before', array('front'=>$this)); | |
Varien_Profiler::start('mage::app::dispatch::send_response'); | |
$this->getResponse()->sendResponse(); | |
+ //This function flushes all response data to the client and finishes the request. | |
+ // This allows for time consuming tasks to be performed without leaving the connection | |
+ // to the client open. | |
+ if(php_sapi_name() == 'fpm-fcgi' && true === function_exists('fastcgi_finish_request')){ | |
+ fastcgi_finish_request(); | |
+ } | |
Varien_Profiler::stop('mage::app::dispatch::send_response'); | |
Mage::dispatchEvent('controller_front_send_response_after', array('front'=>$this)); | |
return $this; | |
fastcgi_finish_request.patch (END) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://php.net/manual/de/function.fastcgi-finish-request.php