Skip to content

A platform for community discussion. Free, open, simple.

FIX: use `next` instead of `return` in sidekiq_retry_in blocks (#39529)

Joffrey JAFFEUXe2db27a7ba6f
diff --git a/app/jobs/regular/group_smtp_email.rb b/app/jobs/regular/group_smtp_email.rb
index 078606190dc..0d9ac274994 100644
--- a/app/jobs/regular/group_smtp_email.rb
+++ b/app/jobs/regular/group_smtp_email.rb
@@ -15,7 +15,7 @@ module Jobs
# See https://github.com/mperham/sidekiq/blob/3330df0ee37cfd3e0cd3ef01e3e66b584b99d488/lib/sidekiq/job_retry.rb#L216-L234
case exception.wrapped
when Net::SMTPServerBusy
- return 1.hour + (rand(30) * (count + 1))
+ next 1.hour + (rand(30) * (count + 1))
end
end
diff --git a/app/jobs/regular/notify_mailing_list_subscribers.rb b/app/jobs/regular/notify_mailing_list_subscribers.rb
index ef81bf9ce28..64c32b7aa19 100644
--- a/app/jobs/regular/notify_mailing_list_subscribers.rb
+++ b/app/jobs/regular/notify_mailing_list_subscribers.rb
@@ -25,7 +25,7 @@ module Jobs
# See https://github.com/mperham/sidekiq/blob/3330df0ee37cfd3e0cd3ef01e3e66b584b99d488/lib/sidekiq/job_retry.rb#L216-L234
case exception.wrapped
when SocketError
- return RETRY_TIMES[count]
+ next RETRY_TIMES[count]
end
end
diff --git a/app/jobs/regular/user_email.rb b/app/jobs/regular/user_email.rb
index 210ee26236f..3dacea427a9 100644
--- a/app/jobs/regular/user_email.rb
+++ b/app/jobs/regular/user_email.rb
@@ -17,7 +17,7 @@ module Jobs
# See https://github.com/mperham/sidekiq/blob/3330df0ee37cfd3e0cd3ef01e3e66b584b99d488/lib/sidekiq/job_retry.rb#L216-L234
case exception.wrapped
when Net::SMTPServerBusy
- return 1.hour + (rand(30) * (count + 1))
+ next 1.hour + (rand(30) * (count + 1))
end
end
diff --git a/plugins/automation/app/jobs/regular/discourse_automation/trigger.rb b/plugins/automation/app/jobs/regular/discourse_automation/trigger.rb
index 09adc6c47d1..e6acb5717c4 100644
--- a/plugins/automation/app/jobs/regular/discourse_automation/trigger.rb
+++ b/plugins/automation/app/jobs/regular/discourse_automation/trigger.rb
@@ -14,7 +14,7 @@ module Jobs
# See https://github.com/mperham/sidekiq/blob/3330df0ee37cfd3e0cd3ef01e3e66b584b99d488/lib/sidekiq/job_retry.rb#L216-L234
case exception.wrapped
when SocketError
- return RETRY_TIMES[count]
+ next RETRY_TIMES[count]
end
end