Merge remote-tracking branch 'parent/main' into upstream-20240109
This commit is contained in:
commit
d35fa72842
333 changed files with 4444 additions and 2541 deletions
|
@ -13,7 +13,9 @@ module ActiveRecord
|
|||
|
||||
column_names.unshift(primary_key)
|
||||
|
||||
relation = relation.reorder(build_batch_orders(order).to_h).limit(batch_limit)
|
||||
cursor = Array(primary_key)
|
||||
|
||||
relation = relation.reorder(build_batch_orders(cursor, order).to_h).limit(batch_limit)
|
||||
relation.skip_query_cache!
|
||||
|
||||
batch_relation = relation
|
||||
|
|
|
@ -192,6 +192,7 @@ module Mastodon::CLI
|
|||
verify_schema_version!
|
||||
verify_sidekiq_not_active!
|
||||
verify_backup_warning!
|
||||
disable_timeout!
|
||||
end
|
||||
|
||||
def process_deduplications
|
||||
|
@ -251,6 +252,13 @@ module Mastodon::CLI
|
|||
fail_with_message 'Maintenance process stopped.' unless yes?('Continue? (Yes/No)')
|
||||
end
|
||||
|
||||
def disable_timeout!
|
||||
# Remove server-configured timeout if present
|
||||
database_connection.execute(<<~SQL.squish)
|
||||
SET statement_timeout = 0
|
||||
SQL
|
||||
end
|
||||
|
||||
def deduplicate_accounts!
|
||||
remove_index_if_exists!(:accounts, 'index_accounts_on_username_and_domain_lower')
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
task stats: 'mastodon:stats'
|
||||
|
||||
namespace :mastodon do
|
||||
desc 'Report code statistics (KLOCs, etc)'
|
||||
task :stats do
|
||||
require 'rails/code_statistics'
|
||||
[
|
||||
['App Libraries', 'app/lib'],
|
||||
%w(Presenters app/presenters),
|
||||
%w(Policies app/policies),
|
||||
%w(Serializers app/serializers),
|
||||
%w(Services app/services),
|
||||
%w(Validators app/validators),
|
||||
%w(Workers app/workers),
|
||||
].each do |name, dir|
|
||||
STATS_DIRECTORIES << [name, dir]
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue