Skip to content

Commit

Permalink
Change method ordering to make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
audiodude committed Oct 8, 2023
1 parent 4c5910e commit 94d72ba
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions quarry/web/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 = ""
Expand Down

0 comments on commit 94d72ba

Please sign in to comment.