Remove BaseTableManager active attribute (#121020)

This commit is contained in:
Erik Montnemery 2024-07-03 01:29:12 +02:00 committed by GitHub
parent 510315732a
commit a4d889e958
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 4 additions and 3 deletions

View File

@ -24,7 +24,6 @@ class BaseTableManager[_DataT]:
for a table. When data is committed to the database, the
manager will move the data from the pending to the id map.
"""
self.active = False
self.recorder = recorder
self._pending: dict[EventType[Any] | str, _DataT] = {}

View File

@ -32,7 +32,6 @@ class EventDataManager(BaseLRUTableManager[EventData]):
def __init__(self, recorder: Recorder) -> None:
"""Initialize the event type manager."""
super().__init__(recorder, CACHE_SIZE)
self.active = True # always active
def serialize_from_event(self, event: Event) -> bytes | None:
"""Serialize event data."""

View File

@ -28,6 +28,8 @@ CACHE_SIZE = 2048
class EventTypeManager(BaseLRUTableManager[EventTypes]):
"""Manage the EventTypes table."""
active = False
def __init__(self, recorder: Recorder) -> None:
"""Initialize the event type manager."""
super().__init__(recorder, CACHE_SIZE)

View File

@ -37,7 +37,6 @@ class StateAttributesManager(BaseLRUTableManager[StateAttributes]):
def __init__(self, recorder: Recorder) -> None:
"""Initialize the event type manager."""
super().__init__(recorder, CACHE_SIZE)
self.active = True # always active
def serialize_from_event(self, event: Event[EventStateChangedData]) -> bytes | None:
"""Serialize event data."""

View File

@ -24,6 +24,8 @@ CACHE_SIZE = 8192
class StatesMetaManager(BaseLRUTableManager[StatesMeta]):
"""Manage the StatesMeta table."""
active = False
def __init__(self, recorder: Recorder) -> None:
"""Initialize the states meta manager."""
self._did_first_load = False