Skip to content

Commit

Permalink
no. of running task number fix
Browse files Browse the repository at this point in the history
  • Loading branch information
algo7 committed Mar 19, 2023
1 parent 236f8b0 commit 02905c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion container_provisioner/api/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func getRunningTasks(c *fiber.Ctx) error {
currentTaskStatus := "There are no running tasks"

if len(Containers) > 0 {
currentTaskStatus = fmt.Sprintf("%s task(s) running", strconv.Itoa(len(Containers)-1))
currentTaskStatus = fmt.Sprintf("%s task(s) running", strconv.Itoa(len(Containers)-2))
}

return c.Render("tasks", fiber.Map{
Expand Down
4 changes: 2 additions & 2 deletions container_provisioner/containers/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ func CountRunningContainer() int {
if isContainer == "" {
return len(containers)
}
// -1 otherwise the current process will also be counted as a running container
return len(containers) - 1
// 21 otherwise the current process and redis will also be counted as a running container
return len(containers) - 2
}

// tailLog tails the log of the container with the given ID
Expand Down

0 comments on commit 02905c2

Please sign in to comment.