reverseproxy: move the reload out of the write functions
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user