fix potential subscription leaking bug with MaxWaitForEOSE never being effective.

This commit is contained in:
fiatjaf
2026-02-27 06:47:14 -03:00
parent c31b92707b
commit 195cb944e2
3 changed files with 26 additions and 17 deletions
+3 -1
View File
@@ -83,7 +83,9 @@ func (l *Loader[K, V]) Load(ctx context.Context, key K) (value V, err error) {
case <-b.thresholdReached:
case <-time.After(l.wait):
l.batchLock.Lock()
l.curBatcher = l.newBatcher()
if l.curBatcher == b {
l.curBatcher = l.newBatcher()
}
l.batchLock.Unlock()
}