mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-19 23:47:39 +00:00
fixed antipatter by using async main func
This commit is contained in:
@@ -230,7 +230,7 @@ const internalNginx = {
|
||||
* @param {Object} host
|
||||
* @returns {Promise}
|
||||
*/
|
||||
generateConfig: (host_type, host) => {
|
||||
generateConfig: async (host_type, host) => {
|
||||
const nice_host_type = internalNginx.getFileFriendlyHostType(host_type);
|
||||
|
||||
if (config.debug()) {
|
||||
@@ -239,15 +239,13 @@ const internalNginx = {
|
||||
|
||||
const renderEngine = utils.getRenderEngine();
|
||||
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let template = null;
|
||||
let filename = internalNginx.getConfigName(nice_host_type, host.id);
|
||||
|
||||
try {
|
||||
template = fs.readFileSync(__dirname + '/../templates/' + nice_host_type + '.conf', {encoding: 'utf8'});
|
||||
} catch (err) {
|
||||
reject(new error.ConfigurationError(err.message));
|
||||
return;
|
||||
throw new error.ConfigurationError(err.message);
|
||||
}
|
||||
|
||||
let locationsPromise;
|
||||
@@ -312,7 +310,7 @@ const internalNginx = {
|
||||
// Restore locations array
|
||||
host.locations = origLocations;
|
||||
|
||||
resolve(true);
|
||||
return true;
|
||||
})
|
||||
.catch((err) => {
|
||||
if (config.debug()) {
|
||||
@@ -322,7 +320,6 @@ const internalNginx = {
|
||||
throw new error.ConfigurationError(err.message);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user