From 94d72ba96e786b8e9bbca9afaef6dc14fed613b3 Mon Sep 17 00:00:00 2001 From: Travis Briggs Date: Sun, 8 Oct 2023 08:30:48 -0700 Subject: [PATCH] Change method ordering to make mypy happy --- quarry/web/replica.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quarry/web/replica.py b/quarry/web/replica.py index d065342..34ee67f 100644 --- a/quarry/web/replica.py +++ b/quarry/web/replica.py @@ -38,6 +38,13 @@ def _db_name_mangler(self): else "{}_p".format(self.dbname) ) + def get_host_name(self): + if self.is_tools_db: + return self.config["TOOLS_DB_HOST"] + if self.config["REPLICA_DOMAIN"]: + return f"{self.database_name}.{self.config['REPLICA_DOMAIN']}" + return self.database_name + @property def connection(self): self._replica.ping(reconnect=True) @@ -81,13 +88,6 @@ def connection(self, db): sock.connect((host, port)) self._replica.connect(sock=sock) - def get_host_name(self): - if self.is_tools_db: - return self.config["TOOLS_DB_HOST"] - if self.config["REPLICA_DOMAIN"]: - return f"{self.database_name}.{self.config['REPLICA_DOMAIN']}" - return self.database_name - @connection.deleter def connection(self): self.dbname = ""