1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

feat: deactivates collection of stats after 6 hours of idle (#2830)

This commit is contained in:
Amir Raminfar
2024-03-20 10:53:52 -07:00
committed by GitHub
parent f9aabf138c
commit 0ca6624238
5 changed files with 115 additions and 7 deletions

View File

@@ -31,6 +31,13 @@ func (r *RingBuffer[T]) Push(data T) {
}
}
func (r *RingBuffer[T]) Clear() {
r.mutex.Lock()
defer r.mutex.Unlock()
r.data = r.data[:0]
r.start = 0
}
func (r *RingBuffer[T]) Data() []T {
r.mutex.RLock()
defer r.mutex.RUnlock()