Reset breakers when receiving activities
This commit is contained in:
		
							parent
							
								
									2c4901d3fc
								
							
						
					
					
						commit
						448a907ab0
					
				
					 2 changed files with 7 additions and 0 deletions
				
			
		|  | @ -26,6 +26,9 @@ impl MyVerify { | |||
|     ) -> Result<bool, Error> { | ||||
|         let public_key_id = iri!(key_id); | ||||
| 
 | ||||
|         // receiving an activity from a domain indicates it is probably online
 | ||||
|         self.0.reset_breaker(&public_key_id); | ||||
| 
 | ||||
|         let actor_id = if let Some(mut actor_id) = self | ||||
|             .2 | ||||
|             .db | ||||
|  |  | |||
|  | @ -187,6 +187,10 @@ impl Requests { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     pub(crate) fn reset_breaker(&self, iri: &IriString) { | ||||
|         self.breakers.succeed(iri); | ||||
|     } | ||||
| 
 | ||||
|     fn count_err(&self) { | ||||
|         let count = self.consecutive_errors.fetch_add(1, Ordering::Relaxed); | ||||
|         if count + 1 >= self.error_limit { | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue