Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add nomad system garbage collection #135

Closed
wants to merge 1 commit into from

Conversation

cshintov
Copy link
Contributor

@cshintov cshintov commented Feb 29, 2024

nomad-gc-wander.webm

@robinovitch61
Copy link
Owner

Good proof of concept, but I don't think this should be added as-is. Many people won't want to garbage collect accidentally for one reason or another, and it doesn't really make sense to be able to do it from any page. It's also fairly easy to type nomad system gc from a terminal window outside wander. I'd like to hold off on this for now, maybe we can add it when we have node-specific pages.

@robinovitch61
Copy link
Owner

Meta: my preference is to have discussions around features and design on issues rather than in pull requests. If you find yourself writing code implementing something that there's not yet an issue for, please open an issue for it :)

@@ -510,6 +510,23 @@ func (m *Model) handleKeyMsg(msg tea.KeyMsg) tea.Cmd {
}
}

case key.Matches(msg, keymap.KeyMap.GarbageCollect):
err := m.client.System().GarbageCollect()
Copy link
Owner

@robinovitch61 robinovitch61 Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this action hangs for one reason or another, it will hang the whole wander app (unable to navigate, quit, etc). This is why wander runs async actions in Cmds, which run in bubbletea in non-deterministic order in goroutines outside the main application event loop. See https://github.com/charmbracelet/bubbletea/tree/master/tutorials/commands/ for details :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Will keep that in mind.

@cshintov cshintov closed this Mar 1, 2024
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.

2 participants