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

Faster archiving methods #234

Merged
merged 11 commits into from
Jul 16, 2018

Conversation

github0013
Copy link
Contributor

@github0013 github0013 commented Oct 5, 2016

mailbox('[Gmail]/All Mail') can be deadly slow when you have full of emails.
This will fix that by

  1. create a temp folder (label)
  2. put the target email in it
  3. archive it or unarchive it
  4. delete the temp folder

ore added 11 commits September 29, 2016 11:34
when you have significantly large amounts of emails,
mailbox('[Gmail]/All Mail')
will be deadly slow.

create a temp folder(label) and put the target email in it, and finding it by message_id within will be much faster.
@github0013
Copy link
Contributor Author

found better way rather than creating dummy folders around.
https://support.google.com/mail/answer/7190?hl=en

#find is still slow, but I think this is a better approach.

@johnnyshields
Copy link
Contributor

I don't think Base is the right class to implement the find method. It seems Mailbox has a very similar method, can you consider that approach.

@github0013
Copy link
Contributor Author

@johnnyshields

Mailbox seems to be the right place, but I think it's tied to a Gmail's label as a mailbox.
It's in Base#findbecause it uses rfc822msgid over all labels.
github0013@d4d201e#diff-0fe1a6da51e462184e7052479dfb126aR195

@johnnyshields johnnyshields merged commit bdd5983 into gmailgem:master Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants