Comment 4 for bug 784575

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 784575] Re: Change bug notification email to point to new bug +subscriptions page to manage subscriptions

On Thu, May 19, 2011 at 10:59 PM, Gary Poster <email address hidden> wrote:
> Our concern was that sending emails is done without requests. Setting up
> a context for feature flags to work will take time we don't have, and if
> we did set it up, checking feature flags naively would involve a whole
> new set of "potato-programming" queries for each recipient that might
> significantly slow down an important script.  Again, we don't have time
> to deal with that right now.

Ah yes, you need an oracle for 'scopes applicable to user X'. Uhm.

So its fine not to do that, but here is how I would tackle it to avoid
those issues (and this makes the amount of work visible ):
 - setup a single feature controller without a request attached to it.
 - teach the controller how to discard its cached value for a flag
 - add to it a custom handler for 'inTeam:' (spelling?) - this handler
would change the inteam lookup from 'user in team' to 'get all the
members of the team named and do an in-python set lookup'
 - after checking the flag do 'controller.discard_cached_result('flagname')

-Rob