]> git.mxchange.org Git - friendica.git/commitdiff
Lockfile for onepoll, removing old smarty3 cache files.
authorMichael Vogel <icarus@dabo.de>
Fri, 19 Jul 2013 21:38:23 +0000 (23:38 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 19 Jul 2013 21:38:23 +0000 (23:38 +0200)
include/onepoll.php
include/poller.php

index bd20cfdb5300e5347f82170d4679d1650b9adc59..ccf9b38364d775271b613749b6017cf6047c0a72 100644 (file)
@@ -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();
 
index e85a4555d31286767b6e8ebb10bd37a8b81bf7fc..e927430ea9e7ef6ab2831a2b35869c85d7fb7503 100644 (file)
@@ -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());
        }