mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-02 21:03:07 +00:00
fix(timecache): remove panic in first seen cache on Add (#522)
This commit is contained in:
parent
cda3df70f4
commit
3dbc2fd5ba
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user