← Back to team overview

launchpad-dev team mailing list archive

Re: Using a signal to switch to read-only mode

 



On Fri, Jan 8, 2010 at 6:27 PM, Guilherme Salgado <salgado@xxxxxxxxxxxxx> wrote:

We'll have a bunch of callsites for the utility
(DatabaseConfig.main_master/slave, model/pofile.py, webapp/adapter.py,
webapp/authorization.py, webapp/dbpolicy.py, and others), and nearly all
of them would benefit from a cache in the request, so I'd rather do it
in the utility.

If you are caching the request, you need to use a thread global. The reason you are caching the request is so you can access a request annotation. Why not just store your information in a thread global instead of a request annotation?


--
Stuart Bishop <stuart@xxxxxxxxxxxxxxxx>
http://www.stuartbishop.net/

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References