forked from FoundKeyGang/FoundKey
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:
commit
f9420642aa
3 changed files with 4 additions and 4 deletions
|
@ -17,7 +17,7 @@ const ev = new Xev();
|
||||||
/**
|
/**
|
||||||
* Init process
|
* Init process
|
||||||
*/
|
*/
|
||||||
export default async function(): void {
|
export default async function(): Promise<void> {
|
||||||
process.title = `Misskey (${cluster.isPrimary ? 'master' : 'worker'})`;
|
process.title = `Misskey (${cluster.isPrimary ? 'master' : 'worker'})`;
|
||||||
|
|
||||||
if (cluster.isPrimary || envOption.disableClustering) {
|
if (cluster.isPrimary || envOption.disableClustering) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ function greet(): void {
|
||||||
/**
|
/**
|
||||||
* Init master process
|
* Init master process
|
||||||
*/
|
*/
|
||||||
export async function masterMain(): void {
|
export async function masterMain(): Promise<void> {
|
||||||
let config!: Config;
|
let config!: Config;
|
||||||
|
|
||||||
// initialize app
|
// 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);
|
const workers = Math.min(limit, os.cpus().length);
|
||||||
bootLogger.info(`Starting ${workers} worker${workers === 1 ? '' : 's'}...`);
|
bootLogger.info(`Starting ${workers} worker${workers === 1 ? '' : 's'}...`);
|
||||||
await Promise.all([...Array(workers)].map(spawnWorker));
|
await Promise.all([...Array(workers)].map(spawnWorker));
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { initDb } from '@/db/postgre.js';
|
||||||
/**
|
/**
|
||||||
* Init worker process
|
* Init worker process
|
||||||
*/
|
*/
|
||||||
export async function workerMain() {
|
export async function workerMain(): Promise<void> {
|
||||||
await initDb();
|
await initDb();
|
||||||
|
|
||||||
// start server
|
// start server
|
||||||
|
|
Loading…
Reference in a new issue