fix lints in backend boot

This commit is contained in:
Johann150 2022-08-03 00:18:31 +02:00
parent a6df127d3b
commit 2fa90e7f43
Signed by untrusted user: Johann150
GPG Key ID: 9EE6577A2A06F8F1
2 changed files with 8 additions and 6 deletions

View File

@ -17,7 +17,7 @@ const ev = new Xev();
/**
* Init process
*/
export default async function() {
export default async function(): void {
process.title = `Misskey (${cluster.isPrimary ? 'master' : 'worker'})`;
if (cluster.isPrimary || envOption.disableClustering) {
@ -68,7 +68,9 @@ if (!envOption.quiet) {
process.on('uncaughtException', err => {
try {
logger.error(err);
} catch { }
} catch {
// if that fails too there is nothing we can do
}
});
// Dying away...

View File

@ -10,8 +10,8 @@ import semver from 'semver';
import Logger from '@/services/logger.js';
import loadConfig from '@/config/load.js';
import { Config } from '@/config/types.js';
import { envOption } from '../env.js';
import { showMachineInfo } from '@/misc/show-machine-info.js';
import { envOption } from '../env.js';
import { db, initDb } from '../db/postgre.js';
const _filename = fileURLToPath(import.meta.url);
@ -24,7 +24,7 @@ const bootLogger = logger.createSubLogger('boot', 'magenta', false);
const themeColor = chalk.hex('#86b300');
function greet() {
function greet(): void {
if (!envOption.quiet) {
//#region Misskey logo
const v = `v${meta.version}`;
@ -49,7 +49,7 @@ function greet() {
/**
* Init master process
*/
export async function masterMain() {
export async function masterMain(): void {
let config!: Config;
// initialize app
@ -142,7 +142,7 @@ async function connectDb(): Promise<void> {
}
}
async function spawnWorkers(limit: number = 1) {
async function spawnWorkers(limit = 1): void {
const workers = Math.min(limit, os.cpus().length);
bootLogger.info(`Starting ${workers} worker${workers === 1 ? '' : 's'}...`);
await Promise.all([...Array(workers)].map(spawnWorker));