mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
to_dict_uncached: Pipe realm_id from the caller functions.
We pipe realm_id through functions where it is available, this helps us avoid doing query for realm_id in loop when multiple messages are being processed.
This commit is contained in:
@@ -606,7 +606,7 @@ def flush_used_upload_space_cache(sender: Any, **kwargs: Any) -> None:
|
||||
def to_dict_cache_key_id(message_id: int) -> str:
|
||||
return 'message_dict:%d' % (message_id,)
|
||||
|
||||
def to_dict_cache_key(message: 'Message') -> str:
|
||||
def to_dict_cache_key(message: 'Message', realm_id: Optional[int]=None) -> str:
|
||||
return to_dict_cache_key_id(message.id)
|
||||
|
||||
def open_graph_description_cache_key(content: Any, request: HttpRequest) -> str:
|
||||
|
||||
Reference in New Issue
Block a user