zulip/zerver
Steve Howell b742f1241f realm emoji: Use a single cache for all lookups.
The active realm emoji are just a subset of all your
realm emoji, so just use a single cache entry per
realm.

Cache misses should be very infrequent per realm.

If a realm has lots of deactivated realm emoji, then
there's a minor expense to deserialize them, but that
is gonna be dwarfed by all the other more expensive
operations in message-send.

I also renamed the two related functions.  I erred on
the side of using somewhat verbose names, as we don't
want folks to confuse the two use cases. Fortunately
there are somewhat natural affordances to use one or
the other, and mypy helps too.

Finally, I use realm_id instead of realm in places
where we don't need the full Realm object.
2023-07-17 09:35:53 -07:00
..
actions realm emoji: Use a single cache for all lookups. 2023-07-17 09:35:53 -07:00
data_import slack: Handle the special case of permissions denied on team.info call. 2023-06-27 11:04:41 -07:00
integration_fixtures/nagios
lib realm emoji: Use a single cache for all lookups. 2023-07-17 09:35:53 -07:00
management soft activation: Avoid QuerySet and use List instead. 2023-07-13 08:09:14 -07:00
migrations migrations: Backfill extra_data_json for audit log entries. 2023-07-15 09:43:23 -07:00
openapi streams: Send stream creation events when subscribing guests. 2023-07-13 14:04:51 -07:00
tests realm emoji: Use a single cache for all lookups. 2023-07-17 09:35:53 -07:00
tornado mention: Replace 'wildcards' with 'stream_wildcards'. 2023-07-03 22:03:17 -07:00
transaction_tests test_classes: Do not necessary wrap test cases in a transaction. 2023-07-06 11:44:50 -07:00
views realm emoji: Use a single cache for all lookups. 2023-07-17 09:35:53 -07:00
webhooks integrations: Update documentation for Grafana Integration. 2023-07-13 16:56:01 -07:00
worker missed-message: Lock ScheduledMessageNotificationEmail rows. 2023-07-13 11:50:42 -07:00
__init__.py
apps.py requirements: Upgrade Python requirements. 2023-04-03 22:39:21 -07:00
context_processors.py emails: Add corporate_enabled to context for emails. 2023-05-01 10:32:43 -07:00
decorator.py logging_util: Remove dependence on get_current_request. 2023-07-11 22:23:47 -07:00
filters.py
forms.py accounts: Allow user to change email visibility during first login. 2023-05-16 13:52:56 -07:00
logging_handlers.py python: Use Python 3.8 typing.{Protocol,TypedDict}. 2022-04-27 12:57:49 -07:00
middleware.py logging_util: Remove dependence on get_current_request. 2023-07-11 22:23:47 -07:00
models.py realm emoji: Use a single cache for all lookups. 2023-07-17 09:35:53 -07:00
signals.py requirements: Upgrade to Django 4.0. 2022-07-13 16:07:17 -07:00