Add JSDoc comments
This commit is contained in:
parent
f0bce909f6
commit
ef917ebe4e
25
server.js
25
server.js
|
@ -498,15 +498,14 @@ const setupTasks = async function () {
|
||||||
await statsEndpoint.init();
|
await statsEndpoint.init();
|
||||||
|
|
||||||
const cleanupPlugins = await loadPlugins();
|
const cleanupPlugins = await loadPlugins();
|
||||||
|
const consoleTitle = process.title;
|
||||||
const BackUpTitle = process.title;
|
|
||||||
|
|
||||||
const exitProcess = async () => {
|
const exitProcess = async () => {
|
||||||
statsEndpoint.onExit();
|
statsEndpoint.onExit();
|
||||||
if (typeof cleanupPlugins === 'function') {
|
if (typeof cleanupPlugins === 'function') {
|
||||||
await cleanupPlugins();
|
await cleanupPlugins();
|
||||||
}
|
}
|
||||||
setWindowTitle(BackUpTitle);
|
setWindowTitle(consoleTitle);
|
||||||
process.exit();
|
process.exit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -566,6 +565,19 @@ if (listen && !getConfigValue('whitelistMode', true) && !basicAuthMode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the title of the terminal window
|
||||||
|
* @param {string} title Desired title for the window
|
||||||
|
*/
|
||||||
|
function setWindowTitle(title) {
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
process.title = title;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
process.stdout.write(`\x1b]2;${title}\x1b\x5c`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cliArguments.ssl) {
|
if (cliArguments.ssl) {
|
||||||
https.createServer(
|
https.createServer(
|
||||||
{
|
{
|
||||||
|
@ -592,10 +604,3 @@ function ensurePublicDirectoriesExist() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWindowTitle(title) {
|
|
||||||
if (process.platform == 'win32')
|
|
||||||
process.title = title
|
|
||||||
else
|
|
||||||
process.stdout.write('\x1b]2;' + title + '\x1b\x5c')
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue