fix(gateway): synchronize qualification stage evidence

This commit is contained in:
sechmachine
2026-07-30 05:12:48 +07:00
parent 8904753c16
commit a2f8e32d4e
3 changed files with 34 additions and 1 deletions
+2
View File
@@ -125,6 +125,7 @@ type fairPacer struct {
mu sync.Mutex
bytesPerSecond int64
flows map[string]fairPacerFlow
reservations atomic.Uint64
}
type fairPacerFlow struct {
@@ -194,6 +195,7 @@ func (p *fairPacer) reserveAt(now time.Time, flow string, bytes int) time.Time {
func (p *fairPacer) wait(ctx context.Context, flow string, bytes int) error {
target := p.reserveAt(time.Now(), flow, bytes)
p.reservations.Add(1)
if delay := time.Until(target); delay > 0 {
timer := time.NewTimer(delay)
defer timer.Stop()