Skip to content

Commit

Permalink
fix: update dbhost and port
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh6790 committed May 30, 2024
1 parent dfca499 commit 93bb782
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion press/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ def reinstall_site(self, site):
data = {
"mariadb_root_password": self._get_mariadb_root_password(site),
"admin_password": site.get_password("admin_password"),
"managed_database": site.managed_database,
"managed_database_config": self._get_managed_db_config(site),
}

Expand Down
10 changes: 7 additions & 3 deletions press/press/doctype/bench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ def validate(self):
if self.is_new():
self.port_offset = self.get_unused_port_offset()

db_host = frappe.db.get_value("Database Server", self.database_server, "private_ip")
config = {
"db_host": db_host,
"monitor": True,
"redis_cache": "redis://localhost:13000",
"redis_queue": "redis://localhost:11000",
Expand All @@ -202,7 +200,13 @@ def validate(self):
"restart_supervisor_on_update": True,
}

if not db_host and self.managed_database_service:
db_host = frappe.db.get_value("Database Server", self.database_server, "private_ip")

if db_host:
config["db_host"] = self.managed_database_service
config["db_port"] = "3306"

if self.managed_database_service:
config["rds_db"] = 1
config["db_host"] = self.managed_database_service
config["db_port"] = frappe.db.get_value(
Expand Down

0 comments on commit 93bb782

Please sign in to comment.