From 28e1325eb29ba027a0552163330e9ef66ef2226c Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Tue, 23 Jul 2024 16:07:48 +0200 Subject: [PATCH] Prevent sending RESUME if process is already resumed --- process/limiter.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/process/limiter.go b/process/limiter.go index 3d5f85e5..79f791e3 100644 --- a/process/limiter.go +++ b/process/limiter.go @@ -456,10 +456,12 @@ func (l *limiter) limitCPU(ctx context.Context, limit float64, interval time.Dur if factorTopLimit > 0 { factorTopLimit -= 10 } else { - if l.proc != nil { - l.proc.Resume() + if l.cpuThrottling { + if l.proc != nil { + l.proc.Resume() + } + l.cpuThrottling = false } - l.cpuThrottling = false l.lock.Unlock() time.Sleep(100 * time.Millisecond) continue