zulip/humbug
Tim Abbott 3b7d61e45f tornado: Get User and UserProfile objects from a memcached.
This commit has the effect of eliminating all of the non-UserActivity
database queries from the Tornado process -- at least in the uncached
case.

This is safe to do, if a bit fragile, since our Tornado code only
accesses these objects (as opposed to their IDs) in a few places that
are all fine with old data, and I don't expect us to add any new ones
soon:

* UserActivity logging, which I plan to move out of Tornado entirely

* Checking whether we're authenticated in our decorators (which could
  be simplified -- the actual security check is just whether the
  Django session object has a particular field)

* Checking the user realm for whether we should sync to the client
  notices about their Zephyr mirror being up to date, which is quite
  static and I think we can move out of this code path.

But implementation constraints around mapping the user_ids to
user_profile_ids mean that it makes sense to get the actual objects
for now.

This code is not what I want to do long-term.  I expect we'll be able
to clean up the dual User/UserProfile nonsense once we integrate the
upcoming Django 1.5 release, with its support for pluggable User
models, and after that I change, I expect it'll be fairly easy to make
the Tornado code only work with the user ID, not the actual objects.

(imported from commit 82e25b62fd0e3af7c86040600c63a4deec7bec06)
2013-01-11 16:11:07 -05:00
..
__init__.py Initial Django commit: basic account, zephyr stream, narrowing, etc. 2012-08-28 12:44:51 -04:00
backends.py tornado: Get User and UserProfile objects from a memcached. 2013-01-11 16:11:07 -05:00
ratelimit.py Use datetime.min for initial last_error rather than int 0. 2012-12-11 15:59:08 -05:00
settings.py tornado: Get User and UserProfile objects from a memcached. 2013-01-11 16:11:07 -05:00
test_settings.py Fix running test suite on a machine with caching enabled. 2013-01-10 16:59:36 -05:00
urls.py Add alternative terms acceptance workflow. 2013-01-08 17:48:42 -05:00
wsgi.py Remove more commented out example code 2012-10-29 23:21:00 -04:00