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

Nicolas Sebrecht nicolas.s-dev at laposte.net
Fri May 13 13:09:52 BST 2016

On Fri, May 13, 2016 at 08:28:57AM +0200, Łukasz Żarnowiecki wrote:

> Thanks, what do you think about the idea of not closing connection to db
> when using autorefresh?

This would be yet another option. However, adding exceptions about how
we manage the db means supporting more than one context only for this.
I think this is prone to errors and might become yet another subtle bug
in the future.

>                          Opening and closing is quite expensive and
> maybe we could open at the beginning and close on some ctrl+c signal.

I don't think this is that expensive. I expect most of the work to be
done in RAM due to the kernel cache so this should be quite fast and
irrelevant. I usually request for numbers about that kind of claims to
avoid over-engineering. ,-)

Nicolas Sebrecht

More information about the OfflineIMAP-project mailing list