mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-30 09:09:18 +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` |
||
|---|---|---|
| .. | ||
| concerns | ||
| onceoff | ||
| regular | ||
| scheduled | ||
| base.rb | ||