Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use single connection to sync all mailboxes #10117

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

SebastianKrupinski
Copy link
Contributor

@SebastianKrupinski SebastianKrupinski commented Sep 8, 2024

Resolves: #10098

kesselb
kesselb previously requested changes Sep 8, 2024
lib/Service/Sync/ImapToDbSynchronizer.php Outdated Show resolved Hide resolved
lib/Service/Sync/ImapToDbSynchronizer.php Outdated Show resolved Hide resolved
lib/Service/Sync/ImapToDbSynchronizer.php Outdated Show resolved Hide resolved
lib/Service/Sync/SyncService.php Outdated Show resolved Hide resolved
lib/Service/Sync/SyncService.php Outdated Show resolved Hide resolved
lib/Service/Sync/SyncService.php Outdated Show resolved Hide resolved
lib/Service/Sync/SyncService.php Outdated Show resolved Hide resolved
tests/Unit/Service/Sync/SyncServiceTest.php Outdated Show resolved Hide resolved
@@ -109,6 +109,10 @@ public function syncAccount(Account $account,
$snoozeMailboxId = $account->getMailAccount()->getSnoozeMailboxId();
$sentMailboxId = $account->getMailAccount()->getSentMailboxId();
$trashRetentionDays = $account->getMailAccount()->getTrashRetentionDays();
// construct imap client and perform initial connection
$client = $this->clientFactory->getClient($account);
$client->login();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This …

lib/Service/Sync/ImapToDbSynchronizer.php Show resolved Hide resolved
@ChristophWurst
Copy link
Member

Address the reviewer comments, otherwise this is showing full affect for a CLI sync of an account with 16 mailboxes.

Before: 16 logins
After: 1 login

https://blackfire.io/profiles/compare/3e0e51dc-6586-40a6-9106-6c3625f41b7b/graph

image

👍

@ChristophWurst ChristophWurst marked this pull request as ready for review September 13, 2024 05:20
@SebastianKrupinski
Copy link
Contributor Author

/backport to stable4.0

@SebastianKrupinski
Copy link
Contributor Author

/backport to stable3.7

@st3iny st3iny requested review from kesselb and removed request for kesselb September 15, 2024 17:41
@kesselb kesselb dismissed their stale review September 15, 2024 18:02

the comments, duplicating the code, were removed

@SebastianKrupinski SebastianKrupinski merged commit fb32365 into main Sep 16, 2024
34 checks passed
@SebastianKrupinski SebastianKrupinski deleted the fix/issue-10098-mailbox-sync branch September 16, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reuse IMAP client for \OCA\Mail\Service\Sync\ImapToDbSynchronizer::syncAccount
4 participants