]> git.mxchange.org Git - friendica-addons.git/blobdiff - twitter/twitter.php
Merge pull request #396 from annando/1612-twitter-sync
[friendica-addons.git] / twitter / twitter.php
index 934b8d3cec03a9fda1f5ef3ace3a9c022e212d62..0f074ba3179375587accbd77f283a6cc81e58cad 100644 (file)
@@ -625,7 +625,12 @@ function twitter_cron($a,$b) {
        if(count($r)) {
                foreach($r as $rr) {
                        logger('twitter: fetching for user '.$rr['uid']);
-                       twitter_fetchtimeline($a, $rr['uid']);
+
+                       if (get_config("system", "worker")) {
+                               proc_run(PRIORITY_MEDIUM, "addon/twitter/twitter_sync.php", 1, $rr['uid']);
+                       } else {
+                               twitter_fetchtimeline($a, $rr['uid']);
+                       }
                }
        }
 
@@ -647,8 +652,12 @@ function twitter_cron($a,$b) {
                        }
 
                        logger('twitter: importing timeline from user '.$rr['uid']);
-                       twitter_fetchhometimeline($a, $rr["uid"]);
 
+                       if (get_config("system", "worker")) {
+                               proc_run(PRIORITY_MEDIUM, "addon/twitter/twitter_sync.php", 2, $rr['uid']);
+                       } else {
+                               twitter_fetchhometimeline($a, $rr["uid"]);
+                       }
 /*
                        // To-Do
                        // check for new contacts once a day