Speed up serializing event messages (#100017)

This commit is contained in:
J. Nick Koston 2023-09-10 08:25:13 -05:00 committed by GitHub
parent e4af50f955
commit ad4619c038
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -94,7 +94,9 @@ def _cached_event_message(event: Event) -> str:
The IDEN_TEMPLATE is used which will be replaced
with the actual iden in cached_event_message
"""
return message_to_json({"id": IDEN_TEMPLATE, "type": "event", "event": event})
return message_to_json(
{"id": IDEN_TEMPLATE, "type": "event", "event": event.as_dict()}
)
def cached_state_diff_message(iden: int, event: Event) -> str: