Closed bgins closed 4 weeks ago
Can we just remove
CommandContext.CommandContext
altogether? It looks to me like it's never used. (remove it from the strct and inNewSystemContext
just don't set it).
Yeah, good call! Removed it and updated the top-level PR description.
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:https://github.com/Lilypad-Tech/lilypad/blob/b4e56e34a4f6b6b3979e9523731b8952162ad143/pkg/system/context.go#L25-L31
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.