Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factor approximate template size in when batching #348

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

colmsnowplow
Copy link
Collaborator

Won't be exact but will err on the side of caution since the template file's data will be slightly bigger than the empty template.

}, nil
}

func loadRequestTemplate(templateFile string) (*template.Template, error) {
func loadRequestTemplate(templateFile string) (int, *template.Template, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we check and error in case the requestByteLimit or the messageByteLimit set by the user in config are less than the approxTmplSize? Probably means a user mistake, but in that cases all messages will count as oversized.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, pushed a change. Likely if their limit is that low it'll all be oversized regardless, but no harm in adding the check

Copy link
Contributor

@adatzer adatzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Won't be exact but will err on the side of caution since the template file's data will be _slightly_ bigger than the empty template.
@colmsnowplow colmsnowplow force-pushed the account-for-template-size branch from 8bab55a to af5c378 Compare July 2, 2024 17:04
@colmsnowplow colmsnowplow merged commit 01a5aba into feat/batch-templating Jul 2, 2024
1 check passed
@colmsnowplow colmsnowplow deleted the account-for-template-size branch July 2, 2024 17:04
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.

None yet

2 participants