Merge pull request #445 from annando/new-worker

Support for the new worker class
This commit is contained in:
Hypolite Petovan 2017-11-10 14:49:54 -05:00 committed by GitHub
commit 42eefed6e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -5,6 +5,9 @@
* Version: 0.2 * Version: 0.2
* Author: Michael Vogel <http://pirati.ca/profile/heluecht> * Author: Michael Vogel <http://pirati.ca/profile/heluecht>
*/ */
use Friendica\Core\Worker;
require('addon/pumpio/oauth/http.php'); require('addon/pumpio/oauth/http.php');
require('addon/pumpio/oauth/oauth_client.php'); require('addon/pumpio/oauth/oauth_client.php');
require_once('include/enotify.php'); require_once('include/enotify.php');
@ -691,8 +694,7 @@ function pumpio_sync(&$a) {
} }
function pumpio_cron(&$a,$b) { function pumpio_cron(&$a,$b) {
//pumpio_sync($a); Worker::add(PRIORITY_MEDIUM,"addon/pumpio/pumpio_sync.php");
proc_run("php","addon/pumpio/pumpio_sync.php");
} }
function pumpio_fetchtimeline(&$a, $uid) { function pumpio_fetchtimeline(&$a, $uid) {

View file

@ -60,6 +60,8 @@
* Requirements: PHP5, curl [Slinky library] * Requirements: PHP5, curl [Slinky library]
*/ */
use Friendica\Core\Worker;
require_once('include/enotify.php'); require_once('include/enotify.php');
require_once("include/socgraph.php"); require_once("include/socgraph.php");
@ -646,7 +648,7 @@ function twitter_cron($a,$b) {
if(count($r)) { if(count($r)) {
foreach($r as $rr) { foreach($r as $rr) {
logger('twitter: fetching for user '.$rr['uid']); 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']);
} }
} }
@ -668,7 +670,7 @@ function twitter_cron($a,$b) {
} }
logger('twitter: importing timeline from user '.$rr['uid']); 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 // To-Do
// check for new contacts once a day // check for new contacts once a day