mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
- An opt-in feature has been added to the agent to allow deprioritizing non coder-related processes for CPU by setting their niceness level to 10. - Opting in to the feature requires setting CODER_PROC_PRIO_MGMT to a non-empty value.
31 lines
515 B
Go
31 lines
515 B
Go
//go:build !linux
|
|
// +build !linux
|
|
|
|
package agentproc
|
|
|
|
import (
|
|
"syscall"
|
|
|
|
"golang.org/x/xerrors"
|
|
)
|
|
|
|
func NewSyscaller() Syscaller {
|
|
return nopSyscaller{}
|
|
}
|
|
|
|
var errUnimplemented = xerrors.New("unimplemented")
|
|
|
|
type nopSyscaller struct{}
|
|
|
|
func (nopSyscaller) SetPriority(pid int32, priority int) error {
|
|
return errUnimplemented
|
|
}
|
|
|
|
func (nopSyscaller) GetPriority(pid int32) (int, error) {
|
|
return 0, errUnimplemented
|
|
}
|
|
|
|
func (nopSyscaller) Kill(pid int32, sig syscall.Signal) error {
|
|
return errUnimplemented
|
|
}
|