Close http connection in perform method of Request class (#6889)
HTTP connections must be explicitly closed in many cases, and letting perform method close connections makes its callers less redundant and prevent them from forgetting to close connections.
This commit is contained in:
		
				
					committed by
					
						
						Eugen Rochko
					
				
			
			
				
	
			
			
			
						parent
						
							4e71b104e6
						
					
				
				
					commit
					54b273bf99
				
			@@ -777,7 +777,7 @@ namespace :mastodon do
 | 
			
		||||
        progress_bar.increment
 | 
			
		||||
 | 
			
		||||
        begin
 | 
			
		||||
          res = Request.new(:head, account.uri).perform
 | 
			
		||||
          code = Request.new(:head, account.uri).perform(&:code)
 | 
			
		||||
        rescue StandardError
 | 
			
		||||
          # This could happen due to network timeout, DNS timeout, wrong SSL cert, etc,
 | 
			
		||||
          # which should probably not lead to perceiving the account as deleted, so
 | 
			
		||||
@@ -785,7 +785,7 @@ namespace :mastodon do
 | 
			
		||||
          next
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        if [404, 410].include?(res.code)
 | 
			
		||||
        if [404, 410].include?(code)
 | 
			
		||||
          if options[:force]
 | 
			
		||||
            SuspendAccountService.new.call(account)
 | 
			
		||||
            account.destroy
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user