Skip to content

refactor(internal): inject context into DI container#81

Merged
allisson merged 1 commit intomainfrom
improve-internal-app
Mar 2, 2026
Merged

refactor(internal): inject context into DI container#81
allisson merged 1 commit intomainfrom
improve-internal-app

Conversation

@allisson
Copy link
Owner

@allisson allisson commented Mar 2, 2026

Update the dependency injection container to accept context throughout the initialization chain, allowing for better lifecycle management and cancellation support during dependency setup.

  • Update all Container provider and init methods to accept context.Context.
  • Replace the initErrors map with sync.Map to ensure thread-safe error tracking during concurrent dependency initialization.
  • Update CLI commands in cmd/app to pass the command context when retrieving use cases and services from the container.
  • Update integration tests to provide context during container setup and dependency retrieval.

Update the dependency injection container to accept context throughout the
initialization chain, allowing for better lifecycle management and
cancellation support during dependency setup.

- Update all `Container` provider and init methods to accept `context.Context`.
- Replace the `initErrors` map with `sync.Map` to ensure thread-safe error
  tracking during concurrent dependency initialization.
- Update CLI commands in `cmd/app` to pass the command context when
  retrieving use cases and services from the container.
- Update integration tests to provide context during container setup and
  dependency retrieval.
@allisson allisson merged commit e6211ec into main Mar 2, 2026
1 of 2 checks passed
@allisson allisson deleted the improve-internal-app branch March 2, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant