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

FIX: Skip translations for empty or small actions posts #139

Merged
merged 1 commit into from
May 3, 2024

Conversation

nattsw
Copy link
Contributor

@nattsw nattsw commented May 3, 2024

Each time a post is getting serialized, we check if the post's language has already been detected or not. If it has, there are no real side effects, and if it hasn't, the plugin sends a request to the enabled translator to detect the post's language.

The problem happens when we have small actions posts with no raw and the job keeps getting queued endlessly. I considered adding some checks at Jobs::DetectTranslation, or cluster_concurrency 1, so it doesn't re-trigger in the event some actions happen too quickly, but it might seem unnecessary. We'll see.

This PR prevents us from sending the post for language detection.

(There will be another PR to handle Amazon's errors due to misconfiguration)

@nattsw nattsw force-pushed the prevent-job-queue-when-empty branch from ccfd831 to 9c3fe96 Compare May 3, 2024 07:17
@nattsw nattsw merged commit 1c84ffe into main May 3, 2024
3 checks passed
@nattsw nattsw deleted the prevent-job-queue-when-empty branch May 3, 2024 07:44
@nattsw
Copy link
Contributor Author

nattsw commented May 3, 2024

Thank you @ZogStriP !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants