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>
This commit is contained in:
Alessandro (Ale) Segala 2022-06-30 21:36:09 -07:00 committed by GitHub
parent a58d8dddda
commit 0cb7906c41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -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
}