## Summary
- Replace `router.Run()` with explicit `http.Server` + `Shutdown()` so the process exits cleanly when context is cancelled.
- On signal, IMAP watcher stops (respects ctx), HTTP server shuts down with 5s timeout, then `wg.Wait()` returns.
## Changes
- `cmd/bridge/main.go`: Own `http.Server`, start via `ListenAndServe()`, shutdown on `ctx.Done()` with 5s timeout.
## Test Plan
- [x] `go build ./...` — OK
- [x] `go vet ./...` — OK
- [x] `go test ./...` — OK
Fixes #3
Replace router.Run() with explicit http.Server + Shutdown() so the
process exits cleanly when context is cancelled.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
codex
approved these changes 2026-04-28 00:29:33 +07:00
This shutdown path is still covered only indirectly; a focused regression test for signal-driven HTTP shutdown would reduce future risk.
PASS
No blocking issues found.
Validation:
- gofmt -l .: OK
- go vet ./...: OK
- go test ./...: OK
Non-blocking:
- This shutdown path is still covered only indirectly; a focused regression test for signal-driven HTTP shutdown would reduce future risk.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
router.Run()with explicithttp.Server+Shutdown()so the process exits cleanly when context is cancelled.wg.Wait()returns.Changes
cmd/bridge/main.go: Ownhttp.Server, start viaListenAndServe(), shutdown onctx.Done()with 5s timeout.Test Plan
go build ./...— OKgo vet ./...— OKgo test ./...— OKFixes #3
PASS
No blocking issues found.
Validation:
Non-blocking: