Skip to content

Commit b9aabdb

Browse files
committed
chore: Refactor runner selection logic in sched.go
1 parent 4fe9877 commit b9aabdb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/sched.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ func (s *Scheduler) processPending(ctx context.Context) {
121121
}
122122

123123
var runner *runnerRef = nil
124-
if len(runners) > 0 {
124+
if len(runners) > 1 {
125125
var minRef = runners[0].refCount
126126
for _, r := range runners {
127-
if r.refCount <= minRef{
127+
if r.refCount <= minRef && r.refCount < uint(envconfig.NumParallel){
128128
runner = r
129129
minRef = r.refCount
130130
}
131131
}
132132
}
133133
s.loadedMu.Unlock()
134-
134+
135135
if runner != nil {
136136
if runner.needsReload(ctx, pending) {
137137
runnerToExpire = runner

0 commit comments

Comments
 (0)