[PATCH] sqlite: open database when we use it rather than at instantiation time

Łukasz Żarnowiecki dolohow at outlook.com
Fri May 13 07:28:57 BST 2016

> We currently close the database as soon as possible while we handle the status
> backend but this is still too early because autorefresh induces looping on this
> code block.
> Instead of delaying the closing outside of the loop, it's easier to delay the
> opening as late as possible (inside the loop). The downside is that the database
> is opened/closed more than once when autorefresh is enabled. The good news is
> that this make the code much easier.

Thanks, what do you think about the idea of not closing connection to db
when using autorefresh?  Opening and closing is quite expensive and
maybe we could open at the beginning and close on some ctrl+c signal.

More information about the OfflineIMAP-project mailing list