diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index fa9c1c6..09e1904 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -9,7 +9,7 @@ jobs: deploy: runs-on: ubuntu-latest container: - image: goreleaser/goreleaser-cross + image: goreleaser/goreleaser-cross:v1.19.2 steps: - uses: actions/checkout@master with: diff --git a/cmd/agent/main.go b/cmd/agent/main.go index a8ee913..42325f9 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -337,7 +337,12 @@ func handleIcmpPingTask(task *pb.Task, result *pb.TaskResult) { err = pinger.Run() // Blocks until finished. } if err == nil { - result.Delay = float32(pinger.Statistics().AvgRtt.Microseconds()) / 1000.0 + stat := pinger.Statistics() + if stat.PacketsRecv == 0 { + result.Data = "pockets recv 0" + return + } + result.Delay = float32(stat.AvgRtt.Microseconds()) / 1000.0 result.Successful = true } else { result.Data = err.Error()