8000 feat: add agent exec pkg by sreya · Pull Request #15577 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add agent exec pkg #15577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 25, 2024
Prev Previous commit
overlooked changes
  • Loading branch information
sreya committed Nov 22, 2024
commit b8725f25e46544a6963b2393e4954fa9f256ff2d
4 changes: 2 additions & 2 deletions agent/agentexec/cli_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const unset = -2000

// CLI runs the agent-exec command. It should only be called by the cli package.
func CLI() error {
// We lock the OS thread here to avoid a race conditino where the nice priority
// We lock the OS thread here to avoid a race condition where the nice priority
// we get is on a different thread from the one we set it on.
runtime.LockOSThread()
// Nop on success but we do it anyway in case of an error.
Expand Down Expand Up @@ -85,7 +85,7 @@ func CLI() error {
}

func defaultNiceScore() (int, error) {
score, err := unix.Getpriority(unix.PRIO_PROCESS, os.Getpid())
score, err := unix.Getpriority(unix.PRIO_PROCESS, 0)
if err != nil {
return 0, xerrors.Errorf("get nice score: %w", err)
}
Expand Down
3 changes: 3 additions & 0 deletions agent/agentexec/main_linux_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build linux
// +build linux

package agentexec_test

import (
Expand Down
Loading
0