Skip to content

local: runServerCommand() discards the Hono server handle, no shutdown path #869

Description

@YusukeHirao

発見の経緯

ERM (Explicit Resource Management) 導入作業の事前調査で見つかったスコープ外項目。

内容

packages/@burger-editor/local/src/commands/server.ts:43 付近の runServerCommand()serve({...}) の戻り値(http.Server ハンドル)を受け取らずに捨てている。CLI 常駐プロセスとしては実害は小さいが、テスト容易性(プロセスを起動せずサーバーの起動/終了をユニットテストする)の観点で AsyncDisposable 化の価値がある。

対応方針(要検討)

  • serve() の戻り値を保持し、close() を async dispose として公開する
  • 呼び出し側(CLI 起動処理・テスト)でハンドルを受け取れるようにする

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions