mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
fix: 修复直播端到端识别时间戳错误
This commit is contained in:
@@ -62,11 +62,11 @@ 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 len(ocrText.Text) < 10 || strings.Contains(ocrText.Text, ":") {
|
if len(ocrText.Text) < 13 || strings.Contains(ocrText.Text, ":") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// exclude digit(s) recognized as letter(s)
|
// exclude digit(s) recognized as letter(s)
|
||||||
_, errParseInt := strconv.ParseInt(ocrText.Text[:10], 10, 64)
|
_, errParseInt := strconv.ParseInt(ocrText.Text[:13], 10, 64)
|
||||||
if errParseInt != nil {
|
if errParseInt != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -81,11 +81,6 @@ func (ete *EndToEndDelay) getCurrentLiveTime(utcTime time.Time) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(liveTimeText) < 13 {
|
|
||||||
for (13 - len(liveTimeText)) > 0 {
|
|
||||||
liveTimeText += "0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
liveTimeInt, err := strconv.Atoi(liveTimeText)
|
liveTimeInt, err := strconv.Atoi(liveTimeText)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
liveTimeInt = 0
|
liveTimeInt = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user