Skip to content

Move tasks arguments to a Kind#241

Open
jeanpimentel wants to merge 1 commit intociandt:developfrom
jeanpimentel:fix-email-tasks
Open

Move tasks arguments to a Kind#241
jeanpimentel wants to merge 1 commit intociandt:developfrom
jeanpimentel:fix-email-tasks

Conversation

@jeanpimentel
Copy link
Member

Fix exception IllegalArgumentException: Task size too large.

These exceptions appears at cron jobs when the payload is too large, and it occurs a lot since one of the arguments is a html email body.

The maximum task size is 100KB for push queues https://cloud.google.com/appengine/quotas#Task_Queue

We already had the EmailNotification Kind, and it is used to track when a email was sent (with success/failure status).

Changes in it:

  • rule was removed since it isn't used and the value is null for all existing entities
  • subject and body was added to receive the email information
  • timestamp was added to track when the entity was created

Other changes were made in two points: push and execute

  1. When pushing to queue, we copy the EmailConfig information into an EmailNotification entity and save it. Then, we pass just the ID as a parameter instead of all data.
  2. Then, when executing the task, we just retrieve the information from Datastore and proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants