From 8bb9bcbeb21e383c6b875f72015456fcf5c03624 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 13 Aug 2024 13:18:30 +0530 Subject: [PATCH] fix: set port while taking tablewise backup --- agent/site.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/site.py b/agent/site.py index 6bbb7612..13a363d7 100644 --- a/agent/site.py +++ b/agent/site.py @@ -12,7 +12,7 @@ from agent.base import AgentException, Base from agent.job import job, step -from agent.utils import b2mb, get_size +from agent.utils import b2mb, get_size, cint if TYPE_CHECKING: from agent.bench import Bench @@ -47,7 +47,7 @@ def __init__(self, name: str, bench: "Bench"): self.user = self.config["db_name"] self.password = self.config["db_password"] self.host = self.config.get("db_host", self.bench.host) - self.port = self.config.get("db_port", self.bench.db_port) + self.port = cint(self.config.get("db_port", self.bench.db_port)) def bench_execute(self, command, input=None): return self.bench.docker_execute( @@ -505,6 +505,8 @@ def tablewise_backup(self): sort_keys=True, ) data = {"tables": {}} + db_port = self.config.get("db_port", 3306) + for table in tables: backup_file = os.path.join( self.backup_directory, f"{table}.sql.gz"