Use atomicwrites for mission critical core files (#59606)

This commit is contained in:
J. Nick Koston 2021-11-15 04:19:31 -06:00 committed by GitHub
parent 04a258bf21
commit 96f7b0d910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 92 additions and 24 deletions

View file

@ -162,7 +162,9 @@ class DeviceRegistry:
def __init__(self, hass: HomeAssistant) -> None:
"""Initialize the device registry."""
self.hass = hass
self._store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY)
self._store = hass.helpers.storage.Store(
STORAGE_VERSION, STORAGE_KEY, atomic_writes=True
)
self._clear_index()
@callback