router: add singleflight deduplication for concurrent narinfo races
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ib682889f34ad4ad4fb331ee2924dc9916a6a6964
This commit is contained in:
parent
e567491856
commit
41b18dd1f8
8 changed files with 90 additions and 18 deletions
|
|
@ -90,7 +90,7 @@ func main() {
|
|||
probeDone := make(chan struct{})
|
||||
go p.RunProbeLoop(30*time.Second, probeDone)
|
||||
|
||||
r := router.New(db, p, cfg.Cache.TTL.Duration, 5*time.Second)
|
||||
r := router.New(db, p, cfg.Cache.TTL.Duration, 5*time.Second, 10*time.Minute)
|
||||
for _, u := range cfg.Upstreams {
|
||||
if u.PublicKey != "" {
|
||||
if err := r.SetUpstreamKey(u.URL, u.PublicKey); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue