]> git.mxchange.org Git - friendica.git/blobdiff - include/poller.php
Merge https://github.com/friendica/friendica into pull
[friendica.git] / include / poller.php
index 6bca5872f32bbae115b4f768e96755312f75671d..692335aab2f3cd3038cb306387bb96c4683a4267 100644 (file)
@@ -62,6 +62,10 @@ function poller_run(&$argv, &$argc){
 
        proc_run('php',"include/queue.php");
        
+       // run diaspora photo queue process in the background
+
+       proc_run('php',"include/dsprphotoq.php");
+       
        // expire any expired accounts
 
        q("UPDATE user SET `account_expired` = 1 where `account_expired` = 0 
@@ -99,14 +103,26 @@ function poller_run(&$argv, &$argc){
                proc_run('php','include/expire.php');
        }
 
-       // clear old cache
-       Cache::clear();
+       $last = get_config('system','cache_last_cleared');
+
+       if($last) {
+               $next = $last + (3600); // Once per hour
+               $clear_cache = ($next <= time());
+        } else
+               $clear_cache = true;
 
-       // clear old item cache files
-       clear_cache();
+       if ($clear_cache) {
+               // clear old cache
+               Cache::clear();
 
-       // clear cache for photos
-       clear_cache($a->get_basepath(), $a->get_basepath()."/photo");
+               // clear old item cache files
+               clear_cache();
+
+               // clear cache for photos
+               clear_cache($a->get_basepath(), $a->get_basepath()."/photo");
+
+               set_config('system','cache_last_cleared', time());
+       }
 
        $manual_id  = 0;
        $generation = 0;