MCPcopy
hub / github.com/SurgeDM/Surge / WaitN

Method WaitN

internal/engine/multi_limiter.go:19–32  ·  view source on GitHub ↗
(ctx context.Context, n int64)

Source from the content-addressed store, hash-verified

17}
18
19func (m *MultiLimiter) WaitN(ctx context.Context, n int64) error {
20 if m == nil {
21 return nil
22 }
23 for i, l := range m.limiters {
24 if err := l.WaitN(ctx, n); err != nil {
25 for j := 0; j < i; j++ {
26 m.limiters[j].Refund(n)
27 }
28 return err
29 }
30 }
31 return nil
32}

Calls 2

RefundMethod · 0.80
WaitNMethod · 0.65