Skip to content

Commit 3f93b32

Browse files
Change InvokeAsync to Invoke due to deprecation
1 parent 2f30da5 commit 3f93b32

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

infrastructure/aws/aws.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/base64"
77
"encoding/json"
88
"fmt"
9-
"io"
109
"os"
1110
"path"
1211
"time"
@@ -54,16 +53,16 @@ func (infra *AwsInfrastructure) Run(args infrastructure.InvokeArgs) {
5453
func (infra *AwsInfrastructure) invokeLambda(args interface{}) {
5554
svc := lambda.New(session.New(), infra.config)
5655

57-
svc.InvokeAsync(&lambda.InvokeAsyncInput{
56+
svc.Invoke(&lambda.InvokeInput{
5857
FunctionName: aws.String("goad"),
59-
InvokeArgs: toJSONReadSeeker(args),
58+
Payload: toByteArray(args),
6059
})
6160
}
6261

63-
func toJSONReadSeeker(args interface{}) io.ReadSeeker {
62+
func toByteArray(args interface{}) []byte {
6463
j, err := json.Marshal(args)
6564
handleErr(err)
66-
return bytes.NewReader(j)
65+
return j
6766
}
6867

6968
func handleErr(err error) {

lambda/lambda.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,9 @@ func (l *goadLambda) forkNewLambda() {
547547

548548
j, _ := json.Marshal(args)
549549

550-
output, err := svc.InvokeAsync(&lambda.InvokeAsyncInput{
550+
output, err := svc.Invoke(&lambda.InvokeInput{
551551
FunctionName: aws.String("goad"),
552-
InvokeArgs: bytes.NewReader(j),
552+
Payload: j,
553553
})
554554
fmt.Println(output)
555555
fmt.Println(err)

0 commit comments

Comments
 (0)