From b72688340ffdf0d7424e1914644ec93c800812f6 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Wed, 10 Nov 2021 16:53:55 +0100 Subject: [PATCH] FIX: `LocalJumpError` in rake tasks (#14874) `return` isn't allowed in a block context. A followup to #14865 --- lib/tasks/posts.rake | 2 +- lib/tasks/redis.rake | 2 +- lib/tasks/s3.rake | 2 +- lib/tasks/topics.rake | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/posts.rake b/lib/tasks/posts.rake index 955fa97d8b6..4b7b35e8f72 100644 --- a/lib/tasks/posts.rake +++ b/lib/tasks/posts.rake @@ -54,7 +54,7 @@ end desc 'Rebake all posts with a quote using a letter_avatar' task 'posts:fix_letter_avatars' => :environment do - return unless SiteSetting.external_system_avatars_enabled + next unless SiteSetting.external_system_avatars_enabled search = Post.where("user_id <> -1") .where("raw LIKE '%/letter\_avatar/%' OR cooked LIKE '%/letter\_avatar/%'") diff --git a/lib/tasks/redis.rake b/lib/tasks/redis.rake index 4e5605b4df8..ad824bb503c 100644 --- a/lib/tasks/redis.rake +++ b/lib/tasks/redis.rake @@ -1,7 +1,7 @@ # frozen_string_literal: true task 'redis:clean_up' => ['environment'] do - return unless Rails.configuration.multisite + next unless Rails.configuration.multisite dbs = RailsMultisite::ConnectionManagement.all_dbs dbs << Discourse::SIDEKIQ_NAMESPACE diff --git a/lib/tasks/s3.rake b/lib/tasks/s3.rake index 0e158621278..7b7258d6d47 100644 --- a/lib/tasks/s3.rake +++ b/lib/tasks/s3.rake @@ -179,7 +179,7 @@ task 's3:ensure_cors_rules' => :environment do if !result puts "skipping" - return + next end puts "Assets rules status: #{result[:assets_rules_status]}." diff --git a/lib/tasks/topics.rake b/lib/tasks/topics.rake index a47a0b0c07a..f979e625c7e 100644 --- a/lib/tasks/topics.rake +++ b/lib/tasks/topics.rake @@ -84,7 +84,7 @@ end task "topics:update_fancy_titles" => :environment do if !SiteSetting.title_fancy_entities? puts "fancy topic titles are disabled" - return + next end DB.exec("UPDATE topics SET fancy_title = NULL")