1
0
Fork 0
forked from gitea/nas

Merge commit 'd258ec8e3b' into kb_migration

This commit is contained in:
KMY 2023-03-13 09:30:37 +09:00
commit 33445ffeb2
6 changed files with 8 additions and 14 deletions

View file

@ -301,13 +301,6 @@ Performance/DeletePrefix:
- 'app/services/resolve_account_service.rb' - 'app/services/resolve_account_service.rb'
- 'app/services/tag_search_service.rb' - 'app/services/tag_search_service.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SafeMultiline.
Performance/DeleteSuffix:
Exclude:
- 'lib/tasks/repo.rake'
# Offense count: 19 # Offense count: 19
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
Performance/MapCompact: Performance/MapCompact:

View file

@ -33,7 +33,7 @@ class Auth::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def after_sign_in_path_for(resource) def after_sign_in_path_for(resource)
if resource.email_present? if resource.email_present?
root_path stored_location_for(resource) || root_path
else else
auth_setup_path(missing_email: '1') auth_setup_path(missing_email: '1')
end end

View file

@ -5,7 +5,9 @@ require_relative '../config/boot'
require_relative '../lib/cli' require_relative '../lib/cli'
begin begin
Mastodon::CLI.start(ARGV) Chewy.strategy(:mastodon) do
Mastodon::CLI.start(ARGV)
end
rescue Interrupt rescue Interrupt
exit(130) exit(130)
end end

View file

@ -19,7 +19,6 @@ Chewy.settings = {
# cycle, which takes care of checking if Elasticsearch is enabled # cycle, which takes care of checking if Elasticsearch is enabled
# or not. However, mind that for the Rails console, the :urgent # or not. However, mind that for the Rails console, the :urgent
# strategy is set automatically with no way to override it. # strategy is set automatically with no way to override it.
Chewy.root_strategy = :mastodon
Chewy.request_strategy = :mastodon Chewy.request_strategy = :mastodon
Chewy.use_after_commit_callbacks = false Chewy.use_after_commit_callbacks = false

View file

@ -3,8 +3,8 @@
class Mastodon::SidekiqMiddleware class Mastodon::SidekiqMiddleware
BACKTRACE_LIMIT = 3 BACKTRACE_LIMIT = 3
def call(*) def call(*, &block)
yield Chewy.strategy(:mastodon, &block)
rescue Mastodon::HostValidationError rescue Mastodon::HostValidationError
# Do not retry # Do not retry
rescue => e rescue => e

View file

@ -91,8 +91,8 @@ namespace :repo do
missing_json_files = I18n.available_locales.reject { |locale| Rails.root.join('app', 'javascript', 'mastodon', 'locales', "#{locale}.json").exist? } missing_json_files = I18n.available_locales.reject { |locale| Rails.root.join('app', 'javascript', 'mastodon', 'locales', "#{locale}.json").exist? }
locales_in_files = Dir[Rails.root.join('config', 'locales', '*.yml')].map do |path| locales_in_files = Dir[Rails.root.join('config', 'locales', '*.yml')].map do |path|
file_name = File.basename(path) file_name = File.basename(path, '.yml')
file_name.gsub(/\A(doorkeeper|devise|activerecord|simple_form)\./, '').gsub(/\.yml\z/, '').to_sym file_name.gsub(/\A(doorkeeper|devise|activerecord|simple_form)\./, '').to_sym
end.uniq.compact end.uniq.compact
missing_available_locales = locales_in_files - I18n.available_locales missing_available_locales = locales_in_files - I18n.available_locales