Skip to content

Commit

Permalink
fix: set port while taking tablewise backup
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh6790 committed Sep 3, 2024
1 parent 65e060a commit 0a022f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agent/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 0a022f7

Please sign in to comment.