mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-15 21:00:27 +00:00
Handle network update callbacks in background
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package oomkiller
|
||||
|
||||
import (
|
||||
"context"
|
||||
runtimeDebug "runtime/debug"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -203,14 +204,14 @@ func (t *adaptiveTimer) poll() {
|
||||
t.logger.Warn("memory growth rate critical (report only), usage: ", byteformats.FormatMemoryBytes(sample.usage), t.logDetails(sample))
|
||||
} else {
|
||||
t.logger.Error("memory growth rate critical, usage: ", byteformats.FormatMemoryBytes(sample.usage), t.logDetails(sample), ", resetting network")
|
||||
t.network.ResetNetwork()
|
||||
t.network.ResetNetwork(context.Background())
|
||||
}
|
||||
} else {
|
||||
if t.killerDisabled {
|
||||
t.logger.Warn("memory threshold reached (report only), usage: ", byteformats.FormatMemoryBytes(sample.usage), t.logDetails(sample))
|
||||
} else {
|
||||
t.logger.Error("memory threshold reached, usage: ", byteformats.FormatMemoryBytes(sample.usage), t.logDetails(sample), ", resetting network")
|
||||
t.network.ResetNetwork()
|
||||
t.network.ResetNetwork(context.Background())
|
||||
}
|
||||
}
|
||||
badCleanup()
|
||||
|
||||
Reference in New Issue
Block a user