pass domain object to reduce one query
This commit is contained in:
@@ -112,7 +112,8 @@ async function runStartupTasks() {
|
||||
tasks.push(async function () {
|
||||
if (!settings.dashboardDomain()) return;
|
||||
|
||||
await reverseProxy.writeDashboardConfig(settings.dashboardDomain());
|
||||
const domainObject = await domains.get(settings.dashboardDomain());
|
||||
await reverseProxy.writeDashboardConfig(domainObject);
|
||||
});
|
||||
|
||||
tasks.push(async function () {
|
||||
@@ -281,7 +282,7 @@ async function setDashboardDomain(domain, auditSource) {
|
||||
const domainObject = await domains.get(domain);
|
||||
if (!domain) throw new BoxError(BoxError.NOT_FOUND, 'No such domain');
|
||||
|
||||
await reverseProxy.writeDashboardConfig(domain);
|
||||
await reverseProxy.writeDashboardConfig(domainObject);
|
||||
const fqdn = dns.fqdn(constants.DASHBOARD_LOCATION, domainObject);
|
||||
|
||||
await settings.setDashboardLocation(domain, fqdn);
|
||||
|
||||
Reference in New Issue
Block a user