load hooks inside queue
This commit is contained in:
parent
dbaf3eca07
commit
182582eed8
|
@ -662,12 +662,20 @@ function facebook_post_hook(&$a,&$b) {
|
||||||
|
|
||||||
function fb_queue_hook(&$a,&$b) {
|
function fb_queue_hook(&$a,&$b) {
|
||||||
|
|
||||||
require_once('include/queue_fn.php');
|
$qi = q("SELECT * FROM `queue` WHERE `network` = '%s'",
|
||||||
if((! is_array($b)) || (! count($b)))
|
dbesc(NETWORK_FACEBOOK)
|
||||||
|
);
|
||||||
|
if(! count($qi))
|
||||||
return;
|
return;
|
||||||
foreach($b as $x) {
|
|
||||||
|
require_once('include/queue_fn.php');
|
||||||
|
|
||||||
|
foreach($qi as $x) {
|
||||||
if($x['network'] !== NETWORK_FACEBOOK)
|
if($x['network'] !== NETWORK_FACEBOOK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
logger('facebook_queue: run');
|
||||||
|
|
||||||
$r = q("SELECT `user`.* FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid`
|
$r = q("SELECT `user`.* FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid`
|
||||||
WHERE `contact`.`self` = 1 AND `contact`.`id` = %d LIMIT 1",
|
WHERE `contact`.`self` = 1 AND `contact`.`id` = %d LIMIT 1",
|
||||||
intval($x['cid'])
|
intval($x['cid'])
|
||||||
|
@ -698,7 +706,7 @@ function fb_queue_hook(&$a,&$b) {
|
||||||
dbesc('fb::' . $retj->id),
|
dbesc('fb::' . $retj->id),
|
||||||
intval($item)
|
intval($item)
|
||||||
);
|
);
|
||||||
logger('facebook queue: success: ' . $j);
|
logger('facebook_queue: success: ' . $j);
|
||||||
remove_queue_item($x['id']);
|
remove_queue_item($x['id']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -24,6 +24,8 @@ function queue_run($argv, $argc){
|
||||||
|
|
||||||
$a->set_baseurl(get_config('system','url'));
|
$a->set_baseurl(get_config('system','url'));
|
||||||
|
|
||||||
|
load_hooks();
|
||||||
|
|
||||||
$deadguys = array();
|
$deadguys = array();
|
||||||
|
|
||||||
logger('queue: start');
|
logger('queue: start');
|
||||||
|
|
Loading…
Reference in a new issue