backend: Fix async types in boot

This commit is contained in:
Michcio 2022-09-04 00:46:25 +02:00
parent d1f3353771
commit 13ce1f0d4e
3 changed files with 4 additions and 4 deletions

View file

@ -17,7 +17,7 @@ const ev = new Xev();
/**
* Init process
*/
export default async function(): void {
export default async function(): Promise<void> {
process.title = `Misskey (${cluster.isPrimary ? 'master' : 'worker'})`;
if (cluster.isPrimary || envOption.disableClustering) {

View file

@ -49,7 +49,7 @@ function greet(): void {
/**
* Init master process
*/
export async function masterMain(): void {
export async function masterMain(): Promise<void> {
let config!: Config;
// initialize app
@ -141,7 +141,7 @@ async function connectDb(): Promise<void> {
}
}
async function spawnWorkers(limit = 1): void {
async function spawnWorkers(limit = 1): Promise<void> {
const workers = Math.min(limit, os.cpus().length);
bootLogger.info(`Starting ${workers} worker${workers === 1 ? '' : 's'}...`);
await Promise.all([...Array(workers)].map(spawnWorker));

View file

@ -4,7 +4,7 @@ import { initDb } from '@/db/postgre.js';
/**
* Init worker process
*/
export async function workerMain() {
export async function workerMain(): Promise<void> {
await initDb();
// start server