Skip to content

Commit 54b2699

Browse files
committed
Update var readable
1 parent 3664d20 commit 54b2699

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/jobs/scheduled/automatic_translation_backfill.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ def translate_records(type, record_ids)
9191

9292
def process_batch
9393
models_translated = [Post, Topic].size
94-
translations_to_run = [translations_per_run / models_translated, 1].max
95-
topic_ids = fetch_untranslated_model_ids(Topic, translations_to_run)
96-
translations_to_run = translations_per_run if topic_ids.empty?
97-
post_ids = fetch_untranslated_model_ids(Post, translations_to_run)
94+
translations_per_model = [translations_per_run / models_translated, 1].max
95+
topic_ids = fetch_untranslated_model_ids(Topic, translations_per_model)
96+
translations_per_model = translations_per_run if topic_ids.empty?
97+
post_ids = fetch_untranslated_model_ids(Post, translations_per_model)
9898
return if topic_ids.empty? && post_ids.empty?
9999

100100
translate_records(Topic, topic_ids)

0 commit comments

Comments
 (0)