X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FQueue.php;h=355433492ca074b5965fec72c78921b5855f9fba;hb=f40c57fc204ff47a3cf9f7eab75e8a635566275c;hp=0284d72b7d670fda2421e707666caf3d0a649a23;hpb=71ec84f6dc83f753fe80170cfdfd32d202850d90;p=friendica.git diff --git a/src/Model/Queue.php b/src/Model/Queue.php index 0284d72b7d..355433492c 100644 --- a/src/Model/Queue.php +++ b/src/Model/Queue.php @@ -5,19 +5,19 @@ namespace Friendica\Model; use Friendica\Core\Config; +use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\Util\DateTimeFormat; -require_once 'include/dba.php'; - class Queue { /** * @param string $id id + * @throws \Exception */ public static function updateTime($id) { - logger('queue: requeue item ' . $id); + Logger::log('queue: requeue item ' . $id); $queue = DBA::selectFirst('queue', ['retrial'], ['id' => $id]); if (!DBA::isResult($queue)) { return; @@ -38,10 +38,11 @@ class Queue /** * @param string $id id + * @throws \Exception */ public static function removeItem($id) { - logger('queue: remove queue item ' . $id); + Logger::log('queue: remove queue item ' . $id); DBA::delete('queue', ['id' => $id]); } @@ -51,6 +52,7 @@ class Queue * @param int $cid Contact id * * @return bool The communication with this contact has currently problems + * @throws \Exception */ public static function wasDelayed($cid) { @@ -79,6 +81,8 @@ class Queue * @param string $network network * @param string $msg message * @param boolean $batch batch, default false + * @param string $guid + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public static function add($cid, $network, $msg, $batch = false, $guid = '') { @@ -100,10 +104,10 @@ class Queue if (DBA::isResult($r)) { if ($batch && ($r[0]['total'] > $batch_queue)) { - logger('too many queued items for batch server ' . $cid . ' - discarding message'); + Logger::log('too many queued items for batch server ' . $cid . ' - discarding message'); return; } elseif ((! $batch) && ($r[0]['total'] > $max_queue)) { - logger('too many queued items for contact ' . $cid . ' - discarding message'); + Logger::log('too many queued items for contact ' . $cid . ' - discarding message'); return; } } @@ -117,6 +121,6 @@ class Queue 'content' => $msg, 'batch' =>($batch) ? 1 : 0 ]); - logger('Added item ' . $guid . ' for ' . $cid); + Logger::log('Added item ' . $guid . ' for ' . $cid); } }