Closed lg closed 4 years ago
As of version 0.7.0 (Aug 19, 2018) this gem is officially deprecated and will no longer be maintained. Please instead use Google's official Gmail API Ruby Client, which uses the Gmail API rather than IMAP and has significantly better performance and reliability.
in the
Mailbox.emails
andMailbox.emails_in_batches
methods you retrieve each email, do theyield
call and then.collect
on it and keep it in memory to return (again) after the call finishes. when looping over thousands of emails, this will keep them all in memory and slow thing down to a crawl.i would suggest either requiring the block (so the
yield
passes the relevant info back) and not returning anything (i.e. no more.collect
necessary), OR making it more clear that all theMessage
s will be returned on a.emails
call and to use this for small queries only. seeing as you have theyield
already in there, personally i'd say take the first option since the user already has access to the relevant info.the workaround i'm using now to get around this: