From: Michael Vogel Date: Fri, 19 Jul 2013 21:38:23 +0000 (+0200) Subject: Lockfile for onepoll, removing old smarty3 cache files. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4dcd00cf4b80d6cbbb2ee5456ed7d7599ccc33ef;p=friendica.git Lockfile for onepoll, removing old smarty3 cache files. --- diff --git a/include/onepoll.php b/include/onepoll.php index bd20cfdb53..ccf9b38364 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -42,7 +42,7 @@ function onepoll_run(&$argv, &$argc){ load_hooks(); logger('onepoll: start'); - + $manual_id = 0; $generation = 0; $hub_update = false; @@ -56,7 +56,17 @@ function onepoll_run(&$argv, &$argc){ logger('onepoll: no contact'); return; } - + + // Test + $lockpath = get_config('system','lockpath'); + if ($lockpath != '') { + $pidfile = new pidfile($lockpath, 'onepoll'.$contact_id.'.lck'); + if($pidfile->is_already_running()) { + logger("onepoll: Already running for contact ".$contact_id); + exit; + } + } + $d = datetime_convert(); diff --git a/include/poller.php b/include/poller.php index e85a4555d3..e927430ea9 100644 --- a/include/poller.php +++ b/include/poller.php @@ -122,6 +122,9 @@ function poller_run(&$argv, &$argc){ // clear cache for photos clear_cache($a->get_basepath(), $a->get_basepath()."/photo"); + // clear smarty cache + clear_cache($a->get_basepath()."/view/smarty3/compiled", $a->get_basepath()."/view/smarty3/compiled"); + set_config('system','cache_last_cleared', time()); }