From: Michael Date: Sun, 22 Jan 2017 05:20:14 +0000 (+0000) Subject: Use cache instead of config for storing last proc_run time X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=be1db7bdb0563671979d6afb36d322bfc25822b9;p=friendica.git Use cache instead of config for storing last proc_run time --- diff --git a/boot.php b/boot.php index 501ae38c42..ef787c6353 100644 --- a/boot.php +++ b/boot.php @@ -1391,11 +1391,15 @@ class App { // If the last worker fork was less than 10 seconds before then don't fork another one. // This should prevent the forking of masses of workers. if (get_config("system", "worker")) { - if ((time() - get_config("system", "proc_run_started")) < 10) - return; - + $cachekey = "app:proc_run:started"; + $result = Cache::get($cachekey); + if (!is_null($result)) { + if ((time() - $result) < 10) { + return; + } + } // Set the timestamp of the last proc_run - set_config("system", "proc_run_started", time()); + Cache::set($cachekey, time(), CACHE_MINUTE); } $args[0] = ((x($this->config,'php_path')) && (strlen($this->config['php_path'])) ? $this->config['php_path'] : 'php');