-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
\Cron::instance();
is slow, because it always calls the binary method which uses an exec call:
Lines 54 to 56 in a66f447
function binary($path) { | |
if (function_exists('exec')) { | |
exec($path.' -v 2>&1',$out,$ret); |
this cant be skipped, even if you'd set a valid path. Some measurements showed a bottleneck here:
Would love to see some way of avoiding this path check with each and every page load. For now I'm using this workaround:
if ($this->fw->CLI ||
($this->fw->exists('CRON.web',$web) && $web
&& preg_match('/^\/cron\/.*/',$this->fw->PATH)))
\Cron::instance();
This way it's only called when the cron service is really used. Maybe it could fit into its contruct as well 🤔
thx bro ;)