Skip to content

Commit 561279b

Browse files
committed
lint
1 parent 17714ed commit 561279b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

agent/agent.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,6 @@ func (a *agent) manageProcessPriority(ctx context.Context, debouncer *logDebounc
16481648
)
16491649

16501650
for _, proc := range procs {
1651-
16521651
containsFn := func(e string) bool {
16531652
contains := strings.Contains(proc.Cmd(), e)
16541653
return contains
@@ -2099,9 +2098,9 @@ func isCustomOOMScore(agentScore int, process *agentproc.Process) bool {
20992098
return agentScore != score && score != 1000 && score != 0 && score != 998
21002099
}
21012100

2102-
// logDebouncer prevents generating a log for a particular message if
2101+
// logDebouncer skips writing a log for a particular message if
21032102
// it's been emitted within the given interval duration.
2104-
// It's a shoddy implementation use in one spot that should be replaced at
2103+
// It's a shoddy implementation used in one spot that should be replaced at
21052104
// some point.
21062105
type logDebouncer struct {
21072106
logger slog.Logger
@@ -2120,8 +2119,7 @@ func (l *logDebouncer) Error(ctx context.Context, msg string, fields ...any) {
21202119
func (l *logDebouncer) log(ctx context.Context, level slog.Level, msg string, fields ...any) {
21212120
// This (bad) implementation assumes you wouldn't reuse the same msg
21222121
// for different levels.
2123-
last, ok := l.messages[msg]
2124-
if ok && time.Since(last) < l.interval {
2122+
if last, ok := l.messages[msg]; ok && time.Since(last) < l.interval {
21252123
return
21262124
}
21272125
switch level {

0 commit comments

Comments
 (0)