From d81e81e4f38d8943fae66c52390e8a15640a2114 Mon Sep 17 00:00:00 2001 From: Mikael Blotin Date: Tue, 3 Dec 2013 14:42:14 +0100 Subject: [PATCH] [-] BO : Fix timeout handling on product images regeneration --- controllers/admin/AdminImagesController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php index 9a1e2dd9a..e03028ea5 100644 --- a/controllers/admin/AdminImagesController.php +++ b/controllers/admin/AdminImagesController.php @@ -527,6 +527,8 @@ class AdminImagesControllerCore extends AdminController $errors = true; $this->errors[] = Tools::displayError(sprintf('Original image is missing or empty (%s)', $existing_img)); } + if (time() - $this->start_time > $this->max_execution_time - 4) // stop 4 seconds before the tiemout, just enough time to process the end of the page on a slow server + return 'timeout'; } }