diff --git a/lib/Cron/Chunk.php b/lib/Cron/Chunk.php deleted file mode 100644 index b7c87ab3..00000000 --- a/lib/Cron/Chunk.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright 2018, Maxence Lange - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -namespace OCA\Social\Cron; - -use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\TimedJob; -use OCA\Social\Service\ConfigService; -use OCP\AppFramework\QueryException; - -/** - * Class Queue - * - * @package OCA\Social\Cron - */ -class Chunk extends TimedJob { - private ConfigService $configService; - - public function __construct(ITimeFactory $time, ConfigService $configService) { - parent::__construct($time); - $this->setInterval(12 * 3600); // 12 hours - $this->configService = $configService; - } - - - /** - * @param mixed $argument - * - * @throws QueryException - */ - protected function run($argument) { - $size = (int)$this->configService->getAppValue(ConfigService::DATABASE_CHUNK_SIZE); - $this->morphChunks($size); - } - - - /** - * @param int $size - */ - private function morphChunks(int $size): void { - } -} diff --git a/lib/Db/SocialCoreQueryBuilder.php b/lib/Db/SocialCoreQueryBuilder.php index fc8f9644..433de466 100644 --- a/lib/Db/SocialCoreQueryBuilder.php +++ b/lib/Db/SocialCoreQueryBuilder.php @@ -34,7 +34,6 @@ namespace OCA\Social\Db; use OCA\Social\Tools\Db\ExtendedQueryBuilder; use OC\SystemConfig; use OCA\Social\Model\ActivityPub\Actor\Person; -use OCP\DB\QueryBuilder\ICompositeExpression; use OCP\IDBConnection; use OCP\IURLGenerator; use Psr\Log\LoggerInterface; @@ -47,7 +46,6 @@ use Psr\Log\LoggerInterface; class SocialCoreQueryBuilder extends ExtendedQueryBuilder { protected IURLGenerator $urlGenerator; private ?Person $viewer = null; - private int $chunk = 0; public function __construct( IDBConnection $connection, SystemConfig $systemConfig, LoggerInterface $logger, IURLGenerator $urlGenerator @@ -57,32 +55,6 @@ class SocialCoreQueryBuilder extends ExtendedQueryBuilder { $this->urlGenerator = $urlGenerator; } - public function setChunk(int $chunk): self { - $this->chunk = $chunk; - $this->inChunk(); - - return $this; - } - - public function getChunk(): int { - return $this->chunk; - } - - /** - * Limit the request to a chunk - */ - public function inChunk(string $alias = '', ?ICompositeExpression $expr = null): void { - if ($this->getChunk() === 0) { - return; - } - - if ($expr !== null) { - $expr->add($this->exprLimitToDBFieldInt('chunk', $this->getChunk(), $alias)); - - return; - } - $this->limitToDBFieldInt('chunk', $this->getChunk(), $alias); - } public function hasViewer(): bool { return ($this->viewer !== null); diff --git a/lib/Db/SocialCrossQueryBuilder.php b/lib/Db/SocialCrossQueryBuilder.php index bf76c02a..821309e0 100644 --- a/lib/Db/SocialCrossQueryBuilder.php +++ b/lib/Db/SocialCrossQueryBuilder.php @@ -56,7 +56,6 @@ class SocialCrossQueryBuilder extends SocialCoreQueryBuilder { if ($aliasDest !== '') { $this->from(CoreRequestBuilder::TABLE_STREAM_DEST, $aliasDest); -// $this->inChunk($aliasDest); } if ($aliasFollowing !== '') { $this->from(CoreRequestBuilder::TABLE_FOLLOWS, $aliasFollowing); @@ -277,7 +276,6 @@ class SocialCrossQueryBuilder extends SocialCoreQueryBuilder { $orX->add($expr->eq($alias . '.stream_id_prim', $pf . '.object_id_prim')); $on = $expr->andX(); -// $this->inChunk('sa', $on); $viewer = $this->getViewer(); $idPrim = $this->prim($viewer->getId()); diff --git a/lib/Db/StreamRequest.php b/lib/Db/StreamRequest.php index c814c15e..5da6c922 100644 --- a/lib/Db/StreamRequest.php +++ b/lib/Db/StreamRequest.php @@ -359,7 +359,6 @@ class StreamRequest extends StreamRequestBuilder { */ public function getTimelineHome(TimelineOptions $options): array { $qb = $this->getStreamSelectSql($options->getFormat()); - $qb->setChunk(1); $qb->filterType(SocialAppNotification::TYPE); $qb->paginate($options); @@ -396,7 +395,6 @@ class StreamRequest extends StreamRequestBuilder { int $since = 0, int $limit = 5, int $format = Stream::FORMAT_ACTIVITYPUB ): array { $qb = $this->getStreamSelectSql($format); - $qb->setChunk(1); $qb->filterType(SocialAppNotification::TYPE); $qb->limitPaginate($since, $limit); diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 2c030301..993ea03b 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $level @@ -138,10 +138,4 @@ HintException - - - $curl - - -