Merge pull request 'by' (#39) from feat-20230102-001-Robin into test

Reviewed-on: #39
This commit is contained in:
chenhao 2024-01-03 23:00:44 +08:00
commit 944a42c2ee
1 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"os/exec" "os/exec"
"service/library/logger" "service/library/logger"
"strconv" "strconv"
"strings"
) )
var ( var (
@ -25,6 +26,9 @@ func (s *ScriptsService) QueryCallCount(url string, logpath string) (count int,
logger.Error("could not run command: %v", err) logger.Error("could not run command: %v", err)
return return
} }
count, err = strconv.Atoi(string(out)) str := string(out)
str = strings.ReplaceAll(str, "\n", "")
str = strings.ReplaceAll(str, "\r", "")
count, err = strconv.Atoi(str)
return return
} }