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

Add command to delete stale elastic indices #12

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

nicksantamaria
Copy link
Contributor

No description provided.

@nicksantamaria
Copy link
Contributor Author

@GROwen when doing fmt.Printf() or fmt.Sprintf() use the typed placeholders if possible %d for integers, %s for string

if diffInDays > age {
// Add helper function to compute hash from k.
hash := strings.Split(k, "--")[0]
project, err := hashes.LookupProjectFromHash(hash)
Copy link
Contributor

Choose a reason for hiding this comment

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

@nicksantamaria I'd like to refactor this so that indices are grouped by project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You could build up a map of elements here, sort the map with something like gosortmap, then iterate over the sorted map in a separate loop.

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