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 {
|
if factorTopLimit > 0 {
|
||||||
factorTopLimit -= 10
|
factorTopLimit -= 10
|
||||||
} else {
|
} else {
|
||||||
if l.proc != nil {
|
if l.cpuThrottling {
|
||||||
l.proc.Resume()
|
if l.proc != nil {
|
||||||
|
l.proc.Resume()
|
||||||
|
}
|
||||||
|
l.cpuThrottling = false
|
||||||
}
|
}
|
||||||
l.cpuThrottling = false
|
|
||||||
l.lock.Unlock()
|
l.lock.Unlock()
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user