mirror of
https://github.com/logos-messaging/go-waku-rendezvous.git
synced 2026-01-02 13:13:08 +00:00
client: use larger batch in discovery, only poll immediately if full
This commit is contained in:
parent
6c1d28214b
commit
8181424229
@ -180,7 +180,7 @@ func discoverAsync(ctx context.Context, ns string, s inet.Stream, ch chan Regist
|
||||
r := ggio.NewDelimitedReader(s, inet.MessageSizeMax)
|
||||
w := ggio.NewDelimitedWriter(s)
|
||||
|
||||
const batch = 100
|
||||
const batch = 200
|
||||
|
||||
var (
|
||||
cookie []byte
|
||||
@ -203,7 +203,7 @@ func discoverAsync(ctx context.Context, ns string, s inet.Stream, ch chan Regist
|
||||
}
|
||||
}
|
||||
|
||||
if len(regs) < batch/2 {
|
||||
if len(regs) < batch {
|
||||
select {
|
||||
case <-time.After(2 * time.Minute):
|
||||
case <-ctx.Done():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user