Skip to content

Commit

Permalink
fix context
Browse files Browse the repository at this point in the history
  • Loading branch information
h8liu committed Apr 12, 2019
1 parent ec9b73a commit ac07102
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metrics/cloudwatch2/cloudwatch2.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (cw *CloudWatch) Send() error {
Namespace: aws.String(cw.namespace),
MetricData: batch,
})
_, err := req.Send()
_, err := req.Send(context.TODO())
return err
})
}
Expand Down
8 changes: 6 additions & 2 deletions metrics/cloudwatch2/cloudwatch2_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cloudwatch2

import (
"net/http"
"strings"
"testing"

Expand Down Expand Up @@ -87,8 +88,11 @@ func (mcw *mockCloudWatch) PutMetricDataRequest(in *cloudwatch.PutMetricDataInpu
// going across the wire, you just create a dumb aws.Request with either
// aws.Request.Data defined (for succes) or with aws.Request.Error
// to simulate an Error.
Request: &aws.Request{Data: &cloudwatch.PutMetricDataOutput{}},
Input: in,
Request: &aws.Request{
HTTPRequest: &http.Request{Method: "PUT"},
Data: &cloudwatch.PutMetricDataOutput{},
},
Input: in,
}
}

Expand Down

0 comments on commit ac07102

Please sign in to comment.