Skip to content

Commit

Permalink
Add comment doc to USE_FROZEN_DICTS
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods committed Jan 31, 2025
1 parent be047b3 commit 5495be2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions synapse/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@
if TYPE_CHECKING:
from synapse.events.builder import EventBuilder

# Whether we should use frozen_dict in FrozenEvent. Using frozen_dicts prevents
# bugs where we accidentally share e.g. signature dicts. However, converting a
# dict to frozen_dicts is expensive.
#
# NOTE: This is overridden by the configuration by the Synapse worker apps, but
# for the sake of tests, it is set here while it cannot be configured on the
# homeserver object itself.

USE_FROZEN_DICTS = strtobool(os.environ.get("SYNAPSE_USE_FROZEN_DICTS", "0"))
USE_FROZEN_DICTS = False
"""
Whether we should use frozen_dict in FrozenEvent. Using frozen_dicts prevents
bugs where we accidentally share e.g. signature dicts. However, converting a
dict to frozen_dicts is expensive.
NOTE: This is overridden by the configuration by the Synapse worker apps, but
for the sake of tests, it is set here because it cannot be configured on the
homeserver object itself.
"""

T = TypeVar("T")

Expand Down

0 comments on commit 5495be2

Please sign in to comment.