Skip to content

refactor(cmd): Standardize server/worker lifecycle#149

Merged
retr0h merged 3 commits intomainfrom
refactor/server-lifecycle-consistency
Feb 18, 2026
Merged

refactor(cmd): Standardize server/worker lifecycle#149
retr0h merged 3 commits intomainfrom
refactor/server-lifecycle-consistency

Conversation

@retr0h
Copy link
Collaborator

@retr0h retr0h commented Feb 18, 2026

Unify all three server commands (API, worker, NATS) on a shared Lifecycle interface with non-blocking Start()/Stop(ctx) and a runServer helper that handles signal blocking, shutdown timeout, and cleanup ordering.

Key fixes in the worker:

  • Add graceful drain via wg.Wait() in Stop (was missing)
  • Add 10s shutdown timeout (was missing)
  • Add NATS connection cleanup (was leaking)
  • Remove unnecessary double goroutine layer

Also update CLAUDE.md with missing doc references (principles, api-guidelines, configuration, system-architecture) and add a reading path to the contributing guide.

🤖 Generated with Claude Code

Unify all three server commands (API, worker, NATS) on a shared
Lifecycle interface with non-blocking Start()/Stop(ctx) and a
runServer helper that handles signal blocking, shutdown timeout,
and cleanup ordering.

Key fixes in the worker:
- Add graceful drain via wg.Wait() in Stop (was missing)
- Add 10s shutdown timeout (was missing)
- Add NATS connection cleanup (was leaking)
- Remove unnecessary double goroutine layer

Also update CLAUDE.md with missing doc references (principles,
api-guidelines, configuration, system-architecture) and add a
reading path to the contributing guide.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Thank you for contributing to this project! 😊🕹️

retr0h and others added 2 commits February 18, 2026 14:14
Rename all task files to use conventional commit type prefixes
(feat-, fix-, docs-, refactor-, test-, chore-) for consistency
with the project's commit message conventions.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Strip "Feature: ", "Phase N: " prefixes and unnecessary quotes
from task titles since the filename already conveys the type.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@retr0h retr0h merged commit 8a7ddb3 into main Feb 18, 2026
6 checks passed
@retr0h retr0h deleted the refactor/server-lifecycle-consistency branch February 18, 2026 22:23
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/job/worker/server.go 88.23% 2 Missing ⚠️

Impacted file tree graph

@@             Coverage Diff             @@
##              main     #149      +/-   ##
===========================================
- Coverage   100.00%   99.92%   -0.08%     
===========================================
  Files           99       99              
  Lines         2541     2543       +2     
===========================================
  Hits          2541     2541              
- Misses           0        2       +2     
Files with missing lines Coverage Δ
internal/job/worker/server.go 92.59% <88.23%> (-7.41%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69c195f...335f930. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments