Skip to content

Commit

Permalink
Fix async invocation in Python 3 (#1006)
Browse files Browse the repository at this point in the history
See Miserlou/Zappa#1331

Co-authored-by: hellno <[email protected]>
Co-authored-by: javulticat <[email protected]>
  • Loading branch information
3 people authored Dec 29, 2021
1 parent ddc3fbb commit 86a471c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zappa/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def _send(self, message):
Given a message, directly invoke the lamdba function for this task.
"""
message["command"] = "zappa.asynchronous.route_lambda_task"
payload = json.dumps(message).encode("utf-8")
payload = json.dumps(message)
if len(payload) > LAMBDA_ASYNC_PAYLOAD_LIMIT: # pragma: no cover
raise AsyncException("Payload too large for async Lambda call")
self.response = self.client.invoke(
Expand Down Expand Up @@ -259,7 +259,7 @@ def _send(self, message):
Given a message, publish to this topic.
"""
message["command"] = "zappa.asynchronous.route_sns_task"
payload = json.dumps(message).encode("utf-8")
payload = json.dumps(message)
if len(payload) > LAMBDA_ASYNC_PAYLOAD_LIMIT: # pragma: no cover
raise AsyncException("Payload too large for SNS")
self.response = self.client.publish(TargetArn=self.arn, Message=payload)
Expand Down

0 comments on commit 86a471c

Please sign in to comment.