Do no set again nicelevel if it is already set, reduce cpu usage

* Fix logic thar gets nice level to avoide useless renice operations.
* Use maps instead of loop for process name matching
This commit is contained in:
eleksir
2024-04-13 12:41:55 +03:00
parent cf9c8f0b29
commit 227b9006dd
3 changed files with 129 additions and 127 deletions

View File

@@ -32,7 +32,7 @@ type Config struct {
}
type Prio []struct {
Nice int32 `yaml:"nice,omitempty"`
Nice int `yaml:"nice,omitempty"`
Name []string `yaml:"name,omitempty"`
}