Skip to content

Commit fbcd0e6

Browse files
committed
no retry
1 parent cb12b3d commit fbcd0e6

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

app/jobs/regular/detect_translate_post.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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?

app/jobs/regular/detect_translate_topic.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module 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?

app/jobs/regular/translate_categories.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
module 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)

app/jobs/scheduled/posts_locale_detection_backfill.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module Jobs
44
class PostsLocaleDetectionBackfill < ::Jobs::Scheduled
55
every 5.minutes
6+
sidekiq_options retry: false
67
cluster_concurrency 1
78

89
def execute(args)

app/jobs/scheduled/topics_locale_detection_backfill.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module Jobs
44
class TopicsLocaleDetectionBackfill < ::Jobs::Scheduled
55
every 5.minutes
6+
sidekiq_options retry: false
67
cluster_concurrency 1
78

89
def execute(args)

0 commit comments

Comments
 (0)