zulip/zerver
Abhijeet Prasad Bodas b140c17441 mute user: Cache list of muter IDs.
This commit defines a new function `get_muting_users`
which will return a list of IDs of users who have muted
a given user.
Whenever someone mutes/unmutes  a user, the cache will be
flushed, and subsequently when that user sends a message,
the cache will be populated with the list of people who
have muted them (maybe empty).

This data is a good candidate for caching because-

1. The function will later be called from the message send
codepath, and we try to minimize database queries there.

2. The entries will be pretty tiny.

3. The entries won't churn too much. An average user will
send messages much more frequently than get muted/unmuted,
and the first time penalty of hitting the db and populating
the cache should ideally get amortized by avoiding several
DB lookups on subsequent message sends.

The actual code to call this function will be written in
further commits.
2021-04-13 09:08:47 -07:00
..
data_import models/realm: Add a model for storing realm playground information. 2021-04-07 08:20:53 +05:30
lib mute user: Cache list of muter IDs. 2021-04-13 09:08:47 -07:00
management refactor: Rename most of "filter" to "linkifier". 2021-04-05 18:14:07 -07:00
migrations settings: Replace invite_by_admins_policy with invite_to_realm_policy. 2021-04-07 09:02:33 -07:00
openapi api: Add max_message_length field to API data. 2021-04-12 16:03:31 -07:00
templatetags dependencies: Upgrade to webpack-bundle-tracker 1.0.0-alpha.1. 2021-04-06 09:31:35 -07:00
tests mute user: Cache list of muter IDs. 2021-04-13 09:08:47 -07:00
tornado request: Rename validator parameter of REQ to json_validator. 2021-04-07 14:13:06 -07:00
views storage: Fix get_storage and remove_storage with empty keys list. 2021-04-13 08:53:03 -07:00
webhooks request: Rename validator parameter of REQ to json_validator. 2021-04-07 14:13:06 -07:00
worker queue_processors: Simplify unnecessary use of Optional. 2021-04-13 08:54:26 -07:00
__init__.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
apps.py python: Reformat with Black, except quotes. 2021-02-12 13:11:19 -08:00
context_processors.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
decorator.py api: Add REALM_DEACTIVATED error code. 2021-03-31 08:46:13 -07:00
filters.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
forms.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
logging_handlers.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
middleware.py middleware: Do not trust X-Forwarded-For; use X-Real-Ip, set from nginx. 2021-03-31 14:19:38 -07:00
models.py mute user: Cache list of muter IDs. 2021-04-13 09:08:47 -07:00
signals.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00