mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 06:32:18 +02:00
batch: add option for executing requests immediately
We make the default non-lazy, and will make the incoming gossip requests lazy.
This commit is contained in:
@@ -60,6 +60,12 @@ func (s *TimeScheduler) Execute(r *Request) error {
|
||||
time.AfterFunc(s.duration, s.b.trigger)
|
||||
}
|
||||
s.b.reqs = append(s.b.reqs, &req)
|
||||
|
||||
// If this is a non-lazy request, we'll execute the batch immediately.
|
||||
if !r.lazy {
|
||||
go s.b.trigger()
|
||||
}
|
||||
|
||||
s.mu.Unlock()
|
||||
|
||||
// Wait for the batch to process the request. If the batch didn't
|
||||
|
Reference in New Issue
Block a user