Skip to content

Commit

Permalink
adjustments in pfstats for context
Browse files Browse the repository at this point in the history
  • Loading branch information
julsemaan committed May 9, 2018
1 parent ad0ef79 commit 52ba27d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions go/stats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (s radiustype) Test(source interface{}, ctx context.Context) {
UserName_SetString(packet, "tim")
UserPassword_SetString(packet, "12345")
client := radius.DefaultClient
ctx = context.WithTimeout(ctx, 5*time.Second)
ctx, _ = context.WithTimeout(ctx, 5*time.Second)
response, err := client.Exchange(ctx, packet, source.(pfconfigdriver.AuthenticationSourceRadius).Host+":"+source.(pfconfigdriver.AuthenticationSourceRadius).Port)
if err != nil {
StatsdClient.Gauge("source."+source.(pfconfigdriver.AuthenticationSourceRadius).Type+"."+source.(pfconfigdriver.AuthenticationSourceRadius).PfconfigHashNS, 0)
Expand Down Expand Up @@ -156,7 +156,7 @@ func (s eduroamtype) Test(source interface{}, ctx context.Context) {
UserName_SetString(packet, "tim")
UserPassword_SetString(packet, "12345")
client := radius.DefaultClient
ctx = context.WithTimeout(ctx, 5*time.Second)
ctx, _ = context.WithTimeout(ctx, 5*time.Second)
response, err := client.Exchange(ctx, packet, source.(pfconfigdriver.AuthenticationSourceEduroam).Server1Address+":1812")

if err != nil {
Expand Down Expand Up @@ -229,7 +229,6 @@ var StatsdClient *statsd.Client
var ctx context.Context

func main() {
d := time.Now().Add(500 * time.Millisecond)
ctx := context.Background()
ctx = log.LoggerNewContext(ctx)

Expand Down

0 comments on commit 52ba27d

Please sign in to comment.