From 2fa90e7f43f1a953badef0fd4a988fb7d9da8c17 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 3 Aug 2022 00:18:31 +0200 Subject: [PATCH] fix lints in backend boot --- packages/backend/src/boot/index.ts | 6 ++++-- packages/backend/src/boot/master.ts | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/boot/index.ts b/packages/backend/src/boot/index.ts index c3d059225..0cfeca1d3 100644 --- a/packages/backend/src/boot/index.ts +++ b/packages/backend/src/boot/index.ts @@ -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... diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index 0c936e72b..fa3f31215 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -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 { } } -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));