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

Reuse IMAP client for \OCA\Mail\Service\Sync\ImapToDbSynchronizer::syncAccount #10098

Closed
ChristophWurst opened this issue Sep 4, 2024 · 0 comments · Fixed by #10117
Closed

Comments

@ChristophWurst
Copy link
Member

Is your feature request related to a problem? Please describe.

The method \OCA\Mail\Service\Sync\ImapToDbSynchronizer::syncAccount iterates over an account's mailboxes and synchronizes them. For each mailbox we create a new client, which causes a new connection, and slows down the process.

Describe the solution you'd like

  • Create the client instance in \OCA\Mail\Service\Sync\ImapToDbSynchronizer::syncAccount
  • Adjust \OCA\Mail\Service\Sync\ImapToDbSynchronizer::sync to take the client as parameter instead of creating it via the factory

Describe alternatives you've considered

Cache connections in the IMAP client factory: d68749d. Reverted via a23e823 because it caused too many open connections.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ☑️ Done
Development

Successfully merging a pull request may close this issue.

2 participants