mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 16:13:06 +00:00
refactor: apply @openstapps/eslint-config rules
This commit is contained in:
16
src/cli.ts
16
src/cli.ts
@@ -20,8 +20,10 @@ import {render} from 'mustache';
|
||||
import {asyncReadFile, asyncWriteFile} from './common';
|
||||
import {getContainers, getTemplateView} from './main';
|
||||
|
||||
/* eslint-disable unicorn/prefer-module */
|
||||
|
||||
// handle unhandled promise rejections
|
||||
process.on('unhandledRejection', async (error) => {
|
||||
process.on('unhandledRejection', async error => {
|
||||
await Logger.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -42,6 +44,7 @@ async function updateNginxConfig() {
|
||||
.join(',');
|
||||
|
||||
delete require.cache[require.resolve('config')];
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const configFile = require('config');
|
||||
const configHash = JSON.stringify(configFile);
|
||||
|
||||
@@ -50,7 +53,10 @@ async function updateNginxConfig() {
|
||||
Logger.log('Generating new NGINX configuration');
|
||||
|
||||
// render nginx config file
|
||||
const nginxConfig = render(await asyncReadFile('nginx.conf.template', 'utf8'), await getTemplateView(containers));
|
||||
const nginxConfig = render(
|
||||
await asyncReadFile('nginx.conf.template', 'utf8'),
|
||||
await getTemplateView(containers),
|
||||
);
|
||||
|
||||
containerHashCache = containerHash;
|
||||
configHashCache = configHash;
|
||||
@@ -65,9 +71,9 @@ async function updateNginxConfig() {
|
||||
execSync('nginx -s reload');
|
||||
}
|
||||
|
||||
// tslint:disable-next-line:no-magic-numbers - set timeout to update configuration again in 30s
|
||||
setTimeout(updateNginxConfig, 30000);
|
||||
// set timeout to update configuration again in 30s
|
||||
setTimeout(updateNginxConfig, 30_000);
|
||||
}
|
||||
|
||||
// tslint:disable-next-line:no-floating-promises - start the process that checks the docker socket periodically
|
||||
// start the process that checks the docker socket periodically
|
||||
updateNginxConfig();
|
||||
|
||||
Reference in New Issue
Block a user