File tree Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,13 @@ def execute(args)
1515 return if topic . blank? || topic . category &.read_restricted?
1616 end
1717
18- detected_locale = DiscourseTranslator ::PostLocaleDetector . detect_locale ( post )
18+ begin
19+ detected_locale = DiscourseTranslator ::PostLocaleDetector . detect_locale ( post )
20+ rescue FinalDestination ::SSRFDetector ::LookupFailedError
21+ # this job is non-critical
22+ # the backfill job will handle failures
23+ return
24+ end
1925
2026 locales = SiteSetting . automatic_translation_target_languages . split ( "|" )
2127 return if locales . blank?
Original file line number Diff line number Diff line change 22
33module Jobs
44 class DetectTranslateTopic < ::Jobs ::Base
5+ sidekiq_options retry : false
6+
57 def execute ( args )
68 return unless SiteSetting . translator_enabled
79 return unless SiteSetting . experimental_content_translation
@@ -16,7 +18,13 @@ def execute(args)
1618 return if topic . category &.read_restricted?
1719 end
1820
19- detected_locale = DiscourseTranslator ::TopicLocaleDetector . detect_locale ( topic )
21+ begin
22+ detected_locale = DiscourseTranslator ::TopicLocaleDetector . detect_locale ( topic )
23+ rescue FinalDestination ::SSRFDetector ::LookupFailedError
24+ # this job is non-critical
25+ # the backfill job will handle failures
26+ return
27+ end
2028
2129 locales = SiteSetting . automatic_translation_target_languages . split ( "|" )
2230 return if locales . blank?
Original file line number Diff line number Diff line change 33module Jobs
44 class TranslateCategories < ::Jobs ::Base
55 cluster_concurrency 1
6+ sidekiq_options retry : false
7+
68 BATCH_SIZE = 50
79
810 def execute ( args )
Original file line number Diff line number Diff line change 33module Jobs
44 class PostsLocaleDetectionBackfill < ::Jobs ::Scheduled
55 every 5 . minutes
6+ sidekiq_options retry : false
67 cluster_concurrency 1
78
89 def execute ( args )
Original file line number Diff line number Diff line change 33module Jobs
44 class TopicsLocaleDetectionBackfill < ::Jobs ::Scheduled
55 every 5 . minutes
6+ sidekiq_options retry : false
67 cluster_concurrency 1
78
89 def execute ( args )
You can’t perform that action at this time.
0 commit comments