mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 05:35:11 +02:00
Update html5 to use async_add_executor_job (#41788)
This commit is contained in:
@@ -242,7 +242,9 @@ class HTML5PushRegistrationView(HomeAssistantView):
|
||||
try:
|
||||
hass = request.app["hass"]
|
||||
|
||||
await hass.async_add_job(save_json, self.json_path, self.registrations)
|
||||
await hass.async_add_executor_job(
|
||||
save_json, self.json_path, self.registrations
|
||||
)
|
||||
return self.json_message("Push notification subscriber registered.")
|
||||
except HomeAssistantError:
|
||||
if previous_registration is not None:
|
||||
@@ -288,7 +290,9 @@ class HTML5PushRegistrationView(HomeAssistantView):
|
||||
try:
|
||||
hass = request.app["hass"]
|
||||
|
||||
await hass.async_add_job(save_json, self.json_path, self.registrations)
|
||||
await hass.async_add_executor_job(
|
||||
save_json, self.json_path, self.registrations
|
||||
)
|
||||
except HomeAssistantError:
|
||||
self.registrations[found] = reg
|
||||
return self.json_message(
|
||||
|
Reference in New Issue
Block a user