Change activity distribution error handling to skip retrying for deleted accounts (#33617)
This commit is contained in:
		
							parent
							
								
									febdfefafe
								
							
						
					
					
						commit
						092e60eb7d
					
				| 
						 | 
					@ -62,7 +62,7 @@ class ActivityPub::DeliveryWorker
 | 
				
			||||||
    stoplight_wrapper.run do
 | 
					    stoplight_wrapper.run do
 | 
				
			||||||
      request_pool.with(@host) do |http_client|
 | 
					      request_pool.with(@host) do |http_client|
 | 
				
			||||||
        build_request(http_client).perform do |response|
 | 
					        build_request(http_client).perform do |response|
 | 
				
			||||||
          raise Mastodon::UnexpectedResponseError, response unless response_successful?(response) || response_error_unsalvageable?(response)
 | 
					          raise Mastodon::UnexpectedResponseError, response unless response_successful?(response) || response_error_unsalvageable?(response) || unsalvageable_authorization_failure?(response)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          @performed = true
 | 
					          @performed = true
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
| 
						 | 
					@ -70,6 +70,10 @@ class ActivityPub::DeliveryWorker
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def unsalvageable_authorization_failure?(response)
 | 
				
			||||||
 | 
					    @source_account.permanently_unavailable? && response.code == 401
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def stoplight_wrapper
 | 
					  def stoplight_wrapper
 | 
				
			||||||
    Stoplight(@inbox_url)
 | 
					    Stoplight(@inbox_url)
 | 
				
			||||||
      .with_threshold(STOPLIGHT_FAILURE_THRESHOLD)
 | 
					      .with_threshold(STOPLIGHT_FAILURE_THRESHOLD)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue