We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
func (r *PodOOMRecorder) cleanOOMRecords(oomRecords []OOMRecord) []OOMRecord { r.mu.Lock() defer r.mu.Unlock() if len(oomRecords) > r.OOMRecordMaxNumber { records := oomRecords sort.Slice(records, func(i, j int) bool { return records[i].OOMAt.Before(records[j].OOMAt) }) records = records[0:r.OOMRecordMaxNumber] oomRecords = records } return oomRecords }
Describe the bug
您好,想请教一下,这段代码用于清理超过默认保留数量的OOM历史数据,但是看起来排序后,将时间久远的数据排列在数组前面,然后保留了数组前默认条数的数据,也就是说保留了旧数据,而删除了新数据,这样做的考量是什么呢 Reproduce steps
Expected behavior
Screenshots
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered:
I think this is a bug, would you like to fix it ?
Sorry, something went wrong.
Sure, but I’m not sure how to request permission to submit code and initiate a PR. emmmm0.0
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork
Successfully merging a pull request may close this issue.
Describe the bug
您好,想请教一下,这段代码用于清理超过默认保留数量的OOM历史数据,但是看起来排序后,将时间久远的数据排列在数组前面,然后保留了数组前默认条数的数据,也就是说保留了旧数据,而删除了新数据,这样做的考量是什么呢
Reproduce steps
Expected behavior
Screenshots
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: