Did the OpportunisticQM fixes in the wrong order

This commit is contained in:
Mikael Nordfeldth 2016-01-11 13:35:29 +01:00
parent 1121b38eb1
commit ef005987a1

View File

@ -18,7 +18,7 @@ class OpportunisticQueueManager extends DBQueueManager
{ {
protected $qmkey = false; protected $qmkey = false;
protected $max_execution_time = null; protected $max_execution_time = null;
protected $max_execution_margin = null; // margin to execution time, including timeouts etc. protected $max_execution_margin = null; // margin to PHP's max_execution_time
protected $max_queue_items = null; protected $max_queue_items = null;
protected $started_at = null; protected $started_at = null;
@ -65,7 +65,7 @@ class OpportunisticQueueManager extends DBQueueManager
return false; return false;
} }
// If too much time has passed, stop // If too much time has passed, stop
if ($time_passed >= $this->max_execution_time - $this->max_execution_margin) { if ($time_passed >= $this->max_execution_time || $time_passed > ini_get('max_execution_time') - $this->max_execution_margin) {
return false; return false;
} }
// If we have a max-item-limit, check if it has been passed // If we have a max-item-limit, check if it has been passed