chore: Remove CommandContext.CommandContext #410
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request makes the following changes:
CommandContext.CommandContext
We set up the command context with a
CommandContext.CommandContext
and aCommandContext.Ctx
, but they are the same context:lilypad/pkg/system/context.go
Lines 25 to 31 in b4e56e3
CommandContext.CommandContext
is not referenced anywhere outside theCommandContext
type, the set up function, and a clean up call. It seems safe to remove.Task/Issue reference
Closes: https://github.com/Lilypad-Tech/internal/issues/296
Test plan
Run a job. The job should complete successfully.
When services are shut down after the job, they should no longer emit a
CleanupManager: Cleanup called again after already called
warning.Details
We initially noticed this issue when we started seeing
CleanupManager: Cleanup called again after already called
warnings. Cleanup was called on (effectively) the same context, and the same set of functions.The cleanup manager design isn't entirely clear. We think that functions could be associated with their contexts, and then each cleanup function could be run with its context. The current design does not support this approach.
We may want to revisit in the future if we decide we would like more than one context.