mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-05-24 01:19:36 +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]
|
_, ok := tc.m[s]
|
||||||
if ok {
|
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
|
// TODO(#515): Do GC in the background
|
||||||
|
|||||||
@ -1,6 +1,12 @@
|
|||||||
package timecache
|
package timecache
|
||||||
|
|
||||||
import "time"
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
logger "github.com/ipfs/go-log/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
var log = logger.Logger("pubsub/timecache")
|
||||||
|
|
||||||
type Strategy uint8
|
type Strategy uint8
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user