Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritysdx committed Jul 4, 2024
1 parent 17e96a9 commit ffb9bfd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ Usage: goecs [options]
Enable/Disable speed test (default true)
-spnum int
Set the number of servers per operator for speed test (default 2)
-upload
Enable/Disable upload the result (default true)
-ut
Enable/Disable unlock media test (default true)
-v Display version information
Expand Down
2 changes: 2 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ Usage: goecs [options]
Enable/Disable speed test (default true)
-spnum int
Set the number of servers per operator for speed test (default 2)
-upload
Enable/Disable upload the result (default true)
-ut
Enable/Disable unlock media test (default true)
-v Display version information
Expand Down
20 changes: 14 additions & 6 deletions goecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
)

var (
ecsVersion = "v0.0.48"
ecsVersion = "v0.0.49"
menuMode bool
onlyChinaTest bool
input, choice string
Expand Down Expand Up @@ -252,10 +252,10 @@ func main() {
securityTestStatus = false
}
var (
startTime time.Time
wg1, wg2 sync.WaitGroup
basicInfo, securityInfo, emailInfo, mediaInfo string
output, tempOutput string
startTime time.Time
wg1, wg2, wg3 sync.WaitGroup
basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo string
output, tempOutput string
)
// 启动一个goroutine来等待信号,内置计时器
go func() {
Expand Down Expand Up @@ -308,6 +308,13 @@ func main() {
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck)
}
}, tempOutput, output)
if onlyChinaTest || pingTestStatus {
wg3.Add(1)
go func() {
defer wg3.Done()
ptInfo = pt.PingTest()
}()
}
if emailTestStatus {
wg2.Add(1)
go func() {
Expand Down Expand Up @@ -365,7 +372,8 @@ func main() {
output = utils.PrintAndCapture(func() {
if onlyChinaTest || pingTestStatus {
utils.PrintCenteredTitle("三网ICMP的PING值检测", width)
pt.PingTest()
wg3.Wait()
fmt.Println(ptInfo)
}
}, tempOutput, output)
}
Expand Down

0 comments on commit ffb9bfd

Please sign in to comment.