Improve performance of generating non-cryptographically secure uuids (#41314)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-10-07 16:37:01 +02:00
1 parent 451f27bba1
commit 8d5c124deb
6 files changed
+14 -17

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ class AreaEntry:
"""Area Registry Entry."""
name: Optional[str] = attr.ib(default=None)
id: str = attr.ib(factory=uuid_util.uuid_v1mc_hex)
id: str = attr.ib(factory=uuid_util.random_uuid_hex)
class AreaRegistry:
+1 -1
View File
@@ -73,7 +73,7 @@ class DeviceEntry:
area_id: str = attr.ib(default=None)
name_by_user: str = attr.ib(default=None)
entry_type: str = attr.ib(default=None)
id: str = attr.ib(factory=uuid_util.uuid_v1mc_hex)
id: str = attr.ib(factory=uuid_util.random_uuid_hex)
# This value is not stored, just used to keep track of events to fire.
is_new: bool = attr.ib(default=False)