mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 00:17:07 +08:00
Prevent sending RESUME if process is already resumed
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user