mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 13:58:53 +08:00
Using `return` inside a block attempts to return from the enclosing method rather than from the block itself. In Sidekiq's `job_retry` context this raises `LocalJumpError: unexpected return`, which shows up in logs as: ``` Job exception: unexpected return ``` The correct Ruby idiom for exiting a block with a value is `next <value>`. Four jobs had the same pattern: - `app/jobs/regular/user_email.rb` - `app/jobs/regular/group_smtp_email.rb` - `app/jobs/regular/notify_mailing_list_subscribers.rb` - `plugins/automation/app/jobs/regular/discourse_automation/trigger.rb` |
||
|---|---|---|
| .. | ||
| call_zapier_webhook.rb | ||
| send_flag_email.rb | ||
| trigger.rb | ||