mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-03 13:23:07 +00:00
Merge pull request #148 from libp2p/feat/timecache
make timecache duration configurable
This commit is contained in:
commit
fef794ab97
@ -25,6 +25,10 @@ const (
|
||||
defaultValidateThrottle = 8192
|
||||
)
|
||||
|
||||
var (
|
||||
TimeCacheDuration = 120 * time.Second
|
||||
)
|
||||
|
||||
var log = logging.Logger("pubsub")
|
||||
|
||||
// PubSub is the implementation of the pubsub system.
|
||||
@ -175,7 +179,7 @@ func NewPubSub(ctx context.Context, h host.Host, rt PubSubRouter, opts ...Option
|
||||
topics: make(map[string]map[peer.ID]struct{}),
|
||||
peers: make(map[peer.ID]chan *RPC),
|
||||
topicVals: make(map[string]*topicVal),
|
||||
seenMessages: timecache.NewTimeCache(time.Second * 120),
|
||||
seenMessages: timecache.NewTimeCache(TimeCacheDuration),
|
||||
counter: uint64(time.Now().UnixNano()),
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user