reverseproxy: move the reload out of the write functions

This commit is contained in:
Girish Ramakrishnan
2022-11-16 07:55:26 +01:00
parent af870d0eac
commit 15d5dfd406

View File

@@ -467,8 +467,6 @@ async function writeDashboardNginxConfig(fqdn, certificatePath) {
const nginxConfigFilename = path.join(paths.NGINX_APPCONFIG_DIR, `${fqdn}.conf`);
if (!safe.fs.writeFileSync(nginxConfigFilename, nginxConf)) throw new BoxError(BoxError.FS_ERROR, safe.error);
await reload();
}
async function writeDashboardConfig(domainObject) {
@@ -480,6 +478,7 @@ async function writeDashboardConfig(domainObject) {
const certificatePath = await getCertificatePath(dashboardFqdn, domainObject.domain);
await writeDashboardNginxConfig(dashboardFqdn, certificatePath);
await reload();
}
function getNginxConfigFilename(app, fqdn, type) {
@@ -570,8 +569,6 @@ async function writeAppNginxConfig(app, fqdn, type, certificatePath) {
debug(`Error creating nginx config for "${app.fqdn}" : ${safe.error.message}`);
throw new BoxError(BoxError.FS_ERROR, safe.error);
}
await reload();
}
async function writeAppConfigs(app) {
@@ -583,6 +580,8 @@ async function writeAppConfigs(app) {
const certificatePath = await getCertificatePath(location.fqdn, location.domain);
await writeAppNginxConfig(app, location.fqdn, location.type, certificatePath);
}
await reload();
}
async function setUserCertificate(app, fqdn, certificate) {