Merge pull request 'backend: Fix async types in boot' (#108) from Michcio/FoundKey-0x7f:fix/promise-void-in-init into main

Reviewed-on: FoundKeyGang/FoundKey#108
This commit is contained in:
Norm 2022-09-04 19:27:29 +00:00
commit f9420642aa
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