From 0cb7906c41c77ff0f696482bd4138d57f821792c Mon Sep 17 00:00:00 2001 From: "Alessandro (Ale) Segala" <43508+ItalyPaleAle@users.noreply.github.com> Date: Thu, 30 Jun 2022 21:36:09 -0700 Subject: [PATCH] Ensure context propagation in SNS binding (#1825) Spin-off from PR adding contexts to input bindings Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com> Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com> --- bindings/aws/sns/sns.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bindings/aws/sns/sns.go b/bindings/aws/sns/sns.go index 45190ec13..5f90ebe95 100644 --- a/bindings/aws/sns/sns.go +++ b/bindings/aws/sns/sns.go @@ -107,13 +107,11 @@ func (a *AWSSNS) Invoke(ctx context.Context, req *bindings.InvokeRequest) (*bind msg := fmt.Sprintf("%v", payload.Message) subject := fmt.Sprintf("%v", payload.Subject) - input := &sns.PublishInput{ + _, err = a.client.PublishWithContext(ctx, &sns.PublishInput{ Message: &msg, Subject: &subject, TopicArn: &a.topicARN, - } - - _, err = a.client.Publish(input) + }) if err != nil { return nil, err }