Skip to content

Commit

Permalink
fix(backend): MK_ONLY_SERVERオプションを指定した際にクラッシュする問題を修正
Browse files Browse the repository at this point in the history
Fix: #11811
  • Loading branch information
syuilo committed Sep 17, 2023
1 parent 0260a6a commit 0dca6af
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
- nodeinfo 2.1対応
- 自分へのメンション一覧を取得する際のパフォーマンスを向上
- Docker環境でjemallocを使用することでメモリ使用量を削減
- Fix: MK_ONLY_SERVERオプションを指定した際にクラッシュする問題を修正
- Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように
- Fix: 一部のfeatured noteを照会できない問題を修正
- Fix: muteがapiからのuser list timeline取得で機能しない問題を修正
Expand Down
33 changes: 23 additions & 10 deletions packages/backend/src/boot/master.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,34 @@ export async function masterMain() {
process.exit(1);
}

if (envOption.onlyServer) {
await server();
} else if (envOption.onlyQueue) {
await jobQueue();
} else {
await server();
}

bootLogger.succ('Misskey initialized');

if (!envOption.disableClustering) {
if (envOption.disableClustering) {
if (envOption.onlyServer) {
await server();
} else if (envOption.onlyQueue) {
await jobQueue();
} else {
await server();
await jobQueue();
}
} else {
if (envOption.onlyServer) {
// nop
} else if (envOption.onlyQueue) {
// nop
} else {
await server();
}

await spawnWorkers(config.clusterLimit);
}

bootLogger.succ(config.socket ? `Now listening on socket ${config.socket} on ${config.url}` : `Now listening on port ${config.port} on ${config.url}`, null, true);
if (envOption.onlyQueue) {
bootLogger.succ('Queue started', null, true);
} else {
bootLogger.succ(config.socket ? `Now listening on socket ${config.socket} on ${config.url}` : `Now listening on port ${config.port} on ${config.url}`, null, true);
}
}

function showEnvironment(): void {
Expand Down

0 comments on commit 0dca6af

Please sign in to comment.