X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fombqueuehandler.php;h=1df816d1403e2b49566313a8b57a048623a9ce1f;hb=85b9e58e535d44f5973fe14f888dc19f25bcaddd;hp=75e04dd19b53c3ca73d9d83824ee778ea1fd317d;hpb=08d5107cf1a69c2640c96ee8a3d834541a530146;p=quix0rs-gnu-social.git diff --git a/scripts/ombqueuehandler.php b/scripts/ombqueuehandler.php index 75e04dd19b..1df816d140 100755 --- a/scripts/ombqueuehandler.php +++ b/scripts/ombqueuehandler.php @@ -33,19 +33,23 @@ require_once(INSTALLDIR . '/lib/queuehandler.php'); set_error_handler('common_error_handler'); -class OmbQueueHandler { +class OmbQueueHandler extends QueueHandler { function transport() { return 'omb'; } function start() { + $this->log(LOG_INFO, "INITIALIZE"); return true; } function handle_notice($notice) { - if (!$this->is_remote($notice)) { - omb_broadcast_remote_subscribers($notice); + if ($this->is_remote($notice)) { + $this->log(LOG_DEBUG, 'Ignoring remote notice ' . $notice->id); + return true; + } else { + return omb_broadcast_remote_subscribers($notice); } } @@ -54,18 +58,17 @@ class OmbQueueHandler { function is_remote($notice) { $user = User::staticGet($notice->profile_id); - return !$user; + return is_null($user); } } +ini_set("max_execution_time", "0"); +ini_set("max_input_time", "0"); +set_time_limit(0); mb_internal_encoding('UTF-8'); $id = ($argc > 1) ? $argv[1] : NULL; $handler = new OmbQueueHandler($id); -if ($handler->start()) { - $handler->handle_queue(); -} - -$handler->finish(); +$handler->runOnce();