Merge remote-tracking branch 'origin/master'

This commit is contained in:
teivah 2022-07-02 23:34:06 +02:00
commit 8c30bcc57d
No known key found for this signature in database
GPG key ID: 07E4A13FB8F8DF63
2 changed files with 4 additions and 4 deletions

View file

@ -16,8 +16,8 @@ type Event struct {
}
func (c *Cache) TrimOlderThan(since time.Duration) {
c.mu.RLock()
defer c.mu.RUnlock()
c.mu.Lock()
defer c.mu.Unlock()
t := time.Now().Add(-since)
for i := 0; i < len(c.events); i++ {

View file

@ -26,8 +26,8 @@ type Event struct {
}
func (c *Cache) TrimOlderThan(since time.Duration) {
c.mu.RLock()
defer c.mu.RUnlock()
c.mu.Lock()
defer c.mu.Unlock()
t := time.Now().Add(-since)
for i := 0; i < len(c.events); i++ {