mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
fix timestamp recognition error
This commit is contained in:
@@ -62,11 +62,15 @@ func (ete *EndToEndDelay) getCurrentLiveTime(utcTime time.Time) error {
|
|||||||
// filter ocr texts with time format
|
// filter ocr texts with time format
|
||||||
var liveTimeTexts []string
|
var liveTimeTexts []string
|
||||||
for _, ocrText := range ocrTexts {
|
for _, ocrText := range ocrTexts {
|
||||||
if strings.HasPrefix(ocrText.Text, "16") &&
|
if len(ocrText.Text) < 10 || strings.Contains(ocrText.Text, ":") {
|
||||||
len(ocrText.Text) > 8 &&
|
continue
|
||||||
!strings.Contains(ocrText.Text, ":") {
|
|
||||||
liveTimeTexts = append(liveTimeTexts, ocrText.Text)
|
|
||||||
}
|
}
|
||||||
|
// exclude digit(s) recognized as letter(s)
|
||||||
|
_, errParseInt := strconv.ParseInt(ocrText.Text[:10], 10, 64)
|
||||||
|
if errParseInt != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
liveTimeTexts = append(liveTimeTexts, ocrText.Text)
|
||||||
}
|
}
|
||||||
|
|
||||||
var liveTimeText string
|
var liveTimeText string
|
||||||
|
|||||||
Reference in New Issue
Block a user