mirror of
				https://github.com/matrix-org/synapse.git
				synced 2025-11-04 10:11:05 +01:00 
			
		
		
		
	Appease the flake8 gods
This commit is contained in:
		
							parent
							
								
									34ed4f4206
								
							
						
					
					
						commit
						3669065466
					
				@ -129,11 +129,16 @@ class UsernameAvailabilityRestServlet(RestServlet):
 | 
				
			|||||||
        self.registration_handler = hs.get_handlers().registration_handler
 | 
					        self.registration_handler = hs.get_handlers().registration_handler
 | 
				
			||||||
        self.ratelimiter = FederationRateLimiter(
 | 
					        self.ratelimiter = FederationRateLimiter(
 | 
				
			||||||
            hs.get_clock(),
 | 
					            hs.get_clock(),
 | 
				
			||||||
            window_size=2000, # Time window of 2s
 | 
					            # Time window of 2s
 | 
				
			||||||
            sleep_limit=1, # Artificially delay requests if rate > sleep_limit/window_size
 | 
					            window_size=2000,
 | 
				
			||||||
            sleep_msec=1000, # Amount of artificial delay to apply
 | 
					            # Artificially delay requests if rate > sleep_limit/window_size
 | 
				
			||||||
            reject_limit=1, # Error with 429 if more than reject_limit requests are queued
 | 
					            sleep_limit=1,
 | 
				
			||||||
            concurrent_requests=1, # Allow 1 request at a time
 | 
					            # Amount of artificial delay to apply
 | 
				
			||||||
 | 
					            sleep_msec=1000,
 | 
				
			||||||
 | 
					            # Error with 429 if more than reject_limit requests are queued
 | 
				
			||||||
 | 
					            reject_limit=1,
 | 
				
			||||||
 | 
					            # Allow 1 request at a time
 | 
				
			||||||
 | 
					            concurrent_requests=1,
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @defer.inlineCallbacks
 | 
					    @defer.inlineCallbacks
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user