Skip to content

Commit

Permalink
fix(runner): 0 max parallel tasks mean infity
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Oct 15, 2024
1 parent 2f7c25b commit 4016c85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion services/tasks/RemoteJob.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (t *RemoteJob) Run(username string, incomingVersion *string) (err error) {

for _, r := range runners {
n := t.taskPool.GetNumberOfRunningTasksOfRunner(r.ID)
if n < r.MaxParallelTasks {
if n > 0 && n < r.MaxParallelTasks {
runner = &r
break
}
Expand Down
6 changes: 6 additions & 0 deletions web/src/components/RunnerForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export default {
return '/api/runners';
},
beforeSave() {
if (!this.item.max_parallel_tasks) {
this.item.max_parallel_tasks = 0;
}
},
getSingleItemUrl() {
return `/api/runners/${this.itemId}`;
},
Expand Down

0 comments on commit 4016c85

Please sign in to comment.