Create recorder futures with loop.create_future() (#100049)

This commit is contained in:
J. Nick Koston 2023-09-10 11:24:57 -05:00 committed by GitHub
parent 51899ce5ad
commit 50382a609c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,7 +187,7 @@ class Recorder(threading.Thread):
self.auto_purge = auto_purge
self.auto_repack = auto_repack
self.keep_days = keep_days
self._hass_started: asyncio.Future[object] = asyncio.Future()
self._hass_started: asyncio.Future[object] = hass.loop.create_future()
self.commit_interval = commit_interval
self._queue: queue.SimpleQueue[RecorderTask] = queue.SimpleQueue()
self.db_url = uri
@ -198,7 +198,7 @@ class Recorder(threading.Thread):
db_connected: asyncio.Future[bool] = hass.data[DOMAIN].db_connected
self.async_db_connected: asyncio.Future[bool] = db_connected
# Database is ready to use but live migration may be in progress
self.async_db_ready: asyncio.Future[bool] = asyncio.Future()
self.async_db_ready: asyncio.Future[bool] = hass.loop.create_future()
# Database is ready to use and all migration steps completed (used by tests)
self.async_recorder_ready = asyncio.Event()
self._queue_watch = threading.Event()