Fix webserver responsiveness where there are a lot of discoveries (#64719)

This commit is contained in:
J. Nick Koston 2022-01-22 11:29:16 -10:00 committed by GitHub
parent a70c980283
commit 490d8e1136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,12 +7,12 @@ from collections.abc import Iterable, Mapping
from dataclasses import dataclass from dataclasses import dataclass
from types import MappingProxyType from types import MappingProxyType
from typing import Any, TypedDict from typing import Any, TypedDict
import uuid
import voluptuous as vol import voluptuous as vol
from .core import HomeAssistant, callback from .core import HomeAssistant, callback
from .exceptions import HomeAssistantError from .exceptions import HomeAssistantError
from .util import uuid as uuid_util
RESULT_TYPE_FORM = "form" RESULT_TYPE_FORM = "form"
RESULT_TYPE_CREATE_ENTRY = "create_entry" RESULT_TYPE_CREATE_ENTRY = "create_entry"
@ -223,7 +223,7 @@ class FlowManager(abc.ABC):
raise UnknownFlow("Flow was not created") raise UnknownFlow("Flow was not created")
flow.hass = self.hass flow.hass = self.hass
flow.handler = handler flow.handler = handler
flow.flow_id = uuid.uuid4().hex flow.flow_id = uuid_util.random_uuid_hex()
flow.context = context flow.context = context
flow.init_data = data flow.init_data = data
self._async_add_flow_progress(flow) self._async_add_flow_progress(flow)