Set statement timeout to zero in maintenance CLI (#33484)
This commit is contained in:
		@@ -192,6 +192,7 @@ module Mastodon::CLI
 | 
				
			|||||||
      verify_schema_version!
 | 
					      verify_schema_version!
 | 
				
			||||||
      verify_sidekiq_not_active!
 | 
					      verify_sidekiq_not_active!
 | 
				
			||||||
      verify_backup_warning!
 | 
					      verify_backup_warning!
 | 
				
			||||||
 | 
					      disable_timeout!
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def process_deduplications
 | 
					    def process_deduplications
 | 
				
			||||||
@@ -251,6 +252,13 @@ module Mastodon::CLI
 | 
				
			|||||||
      fail_with_message 'Maintenance process stopped.' unless yes?('Continue? (Yes/No)')
 | 
					      fail_with_message 'Maintenance process stopped.' unless yes?('Continue? (Yes/No)')
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def disable_timeout!
 | 
				
			||||||
 | 
					      # Remove server-configured timeout if present
 | 
				
			||||||
 | 
					      database_connection.execute(<<~SQL.squish)
 | 
				
			||||||
 | 
					        SET statement_timeout = 0
 | 
				
			||||||
 | 
					      SQL
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def deduplicate_accounts!
 | 
					    def deduplicate_accounts!
 | 
				
			||||||
      remove_index_if_exists!(:accounts, 'index_accounts_on_username_and_domain_lower')
 | 
					      remove_index_if_exists!(:accounts, 'index_accounts_on_username_and_domain_lower')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user