summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2023-04-14 14:06:45 -0400
committerPatrick Cloke <patrickc@matrix.org>2023-05-17 14:26:01 -0400
commit0e67a3f70372c6520deaf7a848ed8cb60f2d0608 (patch)
tree06267cddd69d28454a5cf3c1c273f74ba34863af
parentUpdate changelog. (diff)
downloadsynapse-0e67a3f70372c6520deaf7a848ed8cb60f2d0608.tar.xz
Stop passing in the base-store.
-rw-r--r--synapse/storage/_base.py4
-rw-r--r--synapse/storage/databases/main/__init__.py2
-rw-r--r--synapse/storage/databases/main/relations.py4
3 files changed, 2 insertions, 8 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index a30ebda0c8..481fec72fe 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -25,7 +25,6 @@ from synapse.util.caches.descriptors import CachedFunction
 
 if TYPE_CHECKING:
     from synapse.server import HomeServer
-    from synapse.storage.databases import DataStore
 
 logger = logging.getLogger(__name__)
 
@@ -45,14 +44,11 @@ class SQLBaseStore(metaclass=ABCMeta):
         database: DatabasePool,
         db_conn: LoggingDatabaseConnection,
         hs: "HomeServer",
-        datastore: Optional["DataStore"] = None,
     ):
         self.hs = hs
         self._clock = hs.get_clock()
         self.database_engine = database.engine
         self.db_pool = database
-        # A reference back to the root datastore.
-        self.datastore = datastore
 
         self.external_cached_functions: Dict[str, CachedFunction] = {}
 
diff --git a/synapse/storage/databases/main/__init__.py b/synapse/storage/databases/main/__init__.py
index 80e49dfa8b..ddbc183b4b 100644
--- a/synapse/storage/databases/main/__init__.py
+++ b/synapse/storage/databases/main/__init__.py
@@ -141,7 +141,7 @@ class DataStore(
         super().__init__(database, db_conn, hs)
 
         # This is a bit repetitive, but avoids dynamically setting attributes.
-        self.relations: RelationsStore = RelationsStore(database, db_conn, hs, self)
+        self.relations = RelationsStore(database, db_conn, hs)
 
     async def get_users(self) -> List[JsonDict]:
         """Function to retrieve a list of users in users table.
diff --git a/synapse/storage/databases/main/relations.py b/synapse/storage/databases/main/relations.py
index 2a6af4f8ce..4a6c6c724d 100644
--- a/synapse/storage/databases/main/relations.py
+++ b/synapse/storage/databases/main/relations.py
@@ -52,7 +52,6 @@ from synapse.util.caches.descriptors import cached, cachedList
 
 if TYPE_CHECKING:
     from synapse.server import HomeServer
-    from synapse.storage.databases.main import DataStore
 
 logger = logging.getLogger(__name__)
 
@@ -96,9 +95,8 @@ class RelationsWorkerStore(SQLBaseStore):
         database: DatabasePool,
         db_conn: LoggingDatabaseConnection,
         hs: "HomeServer",
-        datastore: "DataStore",
     ):
-        super().__init__(database, db_conn, hs, datastore)
+        super().__init__(database, db_conn, hs)
 
         self.db_pool.updates.register_background_update_handler(
             "threads_backfill", self._backfill_threads