ops: /api/v1/health does not check MongoDB or Redis

オープン
#56 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
express, javascript, mongodb, node.js, redis

調査の方向性

Start at the /api/v1/health route and check the Render health check configuration, MongoDB connection setup, Redis client, and graceful shutdown handling. Readiness should ping MongoDB and Redis with short timeouts, report Redis as degraded when unavailable, and return 503 for MongoDB failure or shutdown; verify the existing liveness route remains cheap.

索引モデルが issue の本文から書いたものです。

説明

enhancement

GET /api/v1/health always answers { success: true, message: "StudyNotion server is running." }, even when MongoDB or Redis is unreachable. Render's health check and the uptime pings therefore report the service as healthy while requests fail.

Suggested fix

  • Keep a cheap liveness route, and add a readiness route that runs mongoose.connection.db.admin().ping() (and a Redis PING) with short timeouts, returning 503 when MongoDB is down and reporting Redis as degraded because the app can run without it.
  • Point Render's health check path at the readiness route, and flip it to 503 at the start of graceful shutdown so in-flight requests drain.

Found while reviewing StudyNotion with Claude Code.

主要言語
JavaScript
スター
23
フォーク
8
平均マージ
11分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

khemssharma/StudyNotion のほかの issue

khemssharma/StudyNotion の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。