You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-06-03 16:35:37 +02:00
Fix queue task processing (#5549)
This commit is contained in:
+14
-15
@@ -124,25 +124,24 @@ func processQueueTasks(store store.Store, tasks []*model.Task, agentNameMap map[
|
||||
Task: *task,
|
||||
}
|
||||
|
||||
if task.AgentID == 0 {
|
||||
result = append(result, taskResponse)
|
||||
continue
|
||||
if task.AgentID != 0 {
|
||||
name, ok := getAgentName(store, agentNameMap, task.AgentID)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("agent not found for task %s", task.ID)
|
||||
}
|
||||
|
||||
taskResponse.AgentName = name
|
||||
}
|
||||
|
||||
name, ok := getAgentName(store, agentNameMap, task.AgentID)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("agent not found for task %s", task.ID)
|
||||
if task.PipelineID != 0 {
|
||||
p, err := store.GetPipeline(task.PipelineID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("pipeline not found for task %s", task.ID)
|
||||
}
|
||||
|
||||
taskResponse.PipelineNumber = p.Number
|
||||
}
|
||||
|
||||
taskResponse.AgentName = name
|
||||
|
||||
p, err := store.GetPipeline(task.PipelineID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
taskResponse.PipelineNumber = p.Number
|
||||
|
||||
result = append(result, taskResponse)
|
||||
}
|
||||
return result, nil
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
<div class="ml-2 flex items-center gap-2">
|
||||
<IconButton
|
||||
v-if="task.agent_name"
|
||||
v-if="task.pipeline_number"
|
||||
icon="chevron-right"
|
||||
:title="$t('repo.pipeline.view')"
|
||||
class="h-8 w-8"
|
||||
|
||||
Reference in New Issue
Block a user