Skip to content

Commit

Permalink
chore: remove duplicated DatabaseMessageMapper injection
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny committed Aug 31, 2024
1 parent 1015ad1 commit f6ba0ed
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/Service/Sync/ImapToDbSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ class ImapToDbSynchronizer {
/** @var MailboxMapper */
private $mailboxMapper;

/** @var DatabaseMessageMapper */
private $messageMapper;

/** @var Synchronizer */
private $synchronizer;

Expand All @@ -78,7 +75,6 @@ public function __construct(DatabaseMessageMapper $dbMapper,
IMAPClientFactory $clientFactory,
ImapMessageMapper $imapMapper,
MailboxMapper $mailboxMapper,
DatabaseMessageMapper $messageMapper,
Synchronizer $synchronizer,
IEventDispatcher $dispatcher,
PerformanceLogger $performanceLogger,
Expand All @@ -88,7 +84,6 @@ public function __construct(DatabaseMessageMapper $dbMapper,
$this->clientFactory = $clientFactory;
$this->imapMapper = $imapMapper;
$this->mailboxMapper = $mailboxMapper;
$this->messageMapper = $messageMapper;
$this->synchronizer = $synchronizer;
$this->dispatcher = $dispatcher;
$this->performanceLogger = $performanceLogger;
Expand Down Expand Up @@ -177,7 +172,7 @@ public function clearCache(Account $account,
*/
private function resetCache(Account $account, Mailbox $mailbox): void {
$id = $account->getId() . ':' . $mailbox->getName();
$this->messageMapper->deleteAll($mailbox);
$this->dbMapper->deleteAll($mailbox);
$this->logger->debug("All messages of $id cleared");
$mailbox->setSyncNewToken(null);
$mailbox->setSyncChangedToken(null);
Expand Down Expand Up @@ -341,7 +336,7 @@ private function runInitialSync(
// We might need more attempts to fill the cache
$loggingMailboxId = $account->getId() . ':' . $mailbox->getName();
$total = $imapMessages['total'];
$cached = count($this->messageMapper->findAllUids($mailbox));
$cached = count($this->dbMapper->findAllUids($mailbox));
$perf->step('find number of cached UIDs');

$perf->end();
Expand Down

0 comments on commit f6ba0ed

Please sign in to comment.