presence: Use the narrow user cache.

These two endpoints make up ~85% of requests to Zulip servers; since
presence is also a performance-critical endpoint, having them share
the same cache increases how hot it stays in memcached, in addition to
making the presence endpoint faster.

This comes at the very slightly cost of one extra field.  Checks
for the `is_bot` column are switched to the equivalent `bot_type`
check, since the columns are slightly duplicative, and we can get away
with only checking bot_type.
This commit is contained in:
Alex Vandiver
2025-02-11 19:59:37 +00:00
committed by Tim Abbott
parent 44f0e936c2
commit f58c29b290
5 changed files with 40 additions and 4 deletions

View File

@@ -964,6 +964,7 @@ def get_user_profile_narrow_by_id(user_profile_id: int) -> UserProfile:
"id",
"bot_type",
"is_active",
"presence_enabled",
"rate_limits",
"role",
"recipient_id",