-
Notifications
You must be signed in to change notification settings - Fork 52
PERF: Move per-post language detection job into batches using redis #177
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
Conversation
Currently, upon post serialization, we spawn a new job to detect the language of the post. This could potentially flood sidekiq on larger sites. This PR uses redis to keep track of posts that need language detection, then schedules them in a 5-minute-ly job, with a maximum of 1000 posts at a time.
d35ea01 to
add68d4
Compare
|
What are the consequences if we build up a bit of a backlog in this queue? Just need to wait a bit longer for the translations to happen? |
|
@Drenmi for now I believe waiting is fine for language to be detected. Note that this PR involves language detection, not the translation itself.
|
|
@jjaffeux I've incorporated your suggestions :) |
Currently, upon post serialization, we spawn a
new job to detect the language of the post. This
could potentially flood sidekiq on larger sites.
This PR uses redis to keep track of posts that
need language detection, then schedules them in
a 5-minute-ly job, with a maximum of 1000 posts
at a time.
Note for the reviewer: This plugin doesn't seem to be using autoloading as it should yet, but that will come in a separate PR.