]> git.mxchange.org Git - friendica-addons.git/commitdiff
Support for the new worker class
authorMichael <heluecht@pirati.ca>
Sun, 5 Nov 2017 15:07:52 +0000 (15:07 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 5 Nov 2017 15:07:52 +0000 (15:07 +0000)
pumpio/pumpio.php
twitter/twitter.php

index f70801a85d1b09ab12f0be4693b81f4af80967e5..787c29b132d6babe128bcd7ef25ecfae334a06cf 100644 (file)
@@ -5,6 +5,9 @@
  * Version: 0.2
  * Author: Michael Vogel <http://pirati.ca/profile/heluecht>
  */
+
+use Friendica\Core\Worker;
+
 require('addon/pumpio/oauth/http.php');
 require('addon/pumpio/oauth/oauth_client.php');
 require_once('include/enotify.php');
@@ -688,8 +691,7 @@ function pumpio_sync(&$a) {
 }
 
 function pumpio_cron(&$a,$b) {
-       //pumpio_sync($a);
-       proc_run("php","addon/pumpio/pumpio_sync.php");
+       Worker::add(PRIORITY_MEDIUM,"addon/pumpio/pumpio_sync.php");
 }
 
 function pumpio_fetchtimeline(&$a, $uid) {
index 1fdcb89ca773d59cede3b2f70978ff3a9442abee..83d073284766de8759d7c0449c333cb70453253f 100644 (file)
@@ -60,6 +60,8 @@
  *     Requirements: PHP5, curl [Slinky library]
  */
 
+use Friendica\Core\Worker;
+
 require_once('include/enotify.php');
 require_once("include/socgraph.php");
 
@@ -643,7 +645,7 @@ function twitter_cron($a,$b) {
        if(count($r)) {
                foreach($r as $rr) {
                        logger('twitter: fetching for user '.$rr['uid']);
-                       proc_run(PRIORITY_MEDIUM, "addon/twitter/twitter_sync.php", 1, (int)$rr['uid']);
+                       Worker::add(PRIORITY_MEDIUM, "addon/twitter/twitter_sync.php", 1, (int)$rr['uid']);
                }
        }
 
@@ -665,7 +667,7 @@ function twitter_cron($a,$b) {
                        }
 
                        logger('twitter: importing timeline from user '.$rr['uid']);
-                       proc_run(PRIORITY_MEDIUM, "addon/twitter/twitter_sync.php", 2, (int)$rr['uid']);
+                       Worker::add(PRIORITY_MEDIUM, "addon/twitter/twitter_sync.php", 2, (int)$rr['uid']);
 /*
                        // To-Do
                        // check for new contacts once a day