fix(timecache): remove panic in first seen cache on Add (#522)

This commit is contained in:
Hlib Kanunnikov 2023-02-21 12:10:42 +01:00 committed by GitHub
parent cda3df70f4
commit 3dbc2fd5ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -29,7 +29,8 @@ func (tc FirstSeenCache) Add(s string) {
_, ok := tc.m[s]
if ok {
panic("putting the same entry twice not supported")
log.Debug("first-seen: got same entry")
return
}
// TODO(#515): Do GC in the background

View File

@ -1,6 +1,12 @@
package timecache
import "time"
import (
"time"
logger "github.com/ipfs/go-log/v2"
)
var log = logger.Logger("pubsub/timecache")
type Strategy uint8