Only consider the last log line
This commit is contained in:
parent
ce0c8e0025
commit
5020f378c8
@ -746,14 +746,17 @@ func (r *Repository) fetchRepoTests(build_number int) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, line := range logs {
|
if len(logs) < 1 {
|
||||||
if strings.HasPrefix(line.Message, "grade:") {
|
continue
|
||||||
g, err := strconv.ParseFloat(strings.TrimSpace(strings.TrimPrefix(line.Message, "grade:")), 64)
|
}
|
||||||
if err == nil {
|
|
||||||
grade += g
|
line := logs[len(logs)-1]
|
||||||
} else {
|
if strings.HasPrefix(line.Message, "grade:") {
|
||||||
log.Println("Unable to parse grade:", err.Error())
|
g, err := strconv.ParseFloat(strings.TrimSpace(strings.TrimPrefix(line.Message, "grade:")), 64)
|
||||||
}
|
if err == nil {
|
||||||
|
grade += g
|
||||||
|
} else {
|
||||||
|
log.Println("Unable to parse grade:", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user