Skip to content

Commit 757fc19

Browse files
committed
fix: github actions
1 parent 1a4d56a commit 757fc19

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

internal/derperer/derp_endpoint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ func (d *DerpEndpoint) Convert() *DERPRegion {
5050
DERPPort: d.Port,
5151
InsecureForTests: d.Insecure,
5252
},
53-
Latency: d.Latency,
54-
Bandwidth: d.Bandwidth,
53+
Latency: d.Latency.String(),
54+
Bandwidth: d.Bandwidth.String(),
5555
Status: d.Status,
5656
},
5757
},

internal/derperer/extend_map.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package derperer
22

33
import (
4-
"time"
5-
6-
"github.com/yoshino-s/derperer/pkg/speedtest"
74
"tailscale.com/tailcfg"
85
)
96

@@ -19,9 +16,9 @@ type DERPRegion struct {
1916

2017
type DERPNode struct {
2118
tailcfg.DERPNode
22-
Latency time.Duration `json:"latency,omitempty"`
23-
Bandwidth speedtest.Unit `json:"bandwidth,omitempty"`
24-
Status DerpStatus `json:"status,omitempty"`
19+
Latency string `json:"latency,omitempty"`
20+
Bandwidth string `json:"bandwidth,omitempty"`
21+
Status DerpStatus `json:"status,omitempty"`
2522
}
2623

2724
func (n *DERPNode) ToOriginal() *tailcfg.DERPNode {

internal/derperer/map.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func (d *DerpererService) testDerpEndpoint(endpoint *DerpEndpoint) {
4747
res, err := d.SpeedtestService.CheckDerp(endpoint.Convert().ToOriginal(), d.config.CheckDuration)
4848
if err != nil {
4949
d.Logger.Error("failed to check derp", zap.Any("endpoint", endpoint), zap.Error(err))
50+
endpoint.Latency = 0
51+
endpoint.Bandwidth = speedtest.Unit{0, "bps"}
5052
endpoint.Error = err.Error()
5153
endpoint.Status = DerpStatusError
5254
} else {

0 commit comments

Comments
 (0)