mirror of
				https://github.com/matrix-org/synapse.git
				synced 2025-11-04 10:11:05 +01:00 
			
		
		
		
	Increase cache hit ratio for push
We don't update the cache in all code paths, which causes subsequent calls to miss the cache
This commit is contained in:
		
							parent
							
								
									d3862812ff
								
							
						
					
					
						commit
						bfde076022
					
				@ -316,6 +316,14 @@ class RulesForRoom(object):
 | 
				
			|||||||
                yield self._update_rules_with_member_event_ids(
 | 
					                yield self._update_rules_with_member_event_ids(
 | 
				
			||||||
                    ret_rules_by_user, missing_member_event_ids, state_group, event
 | 
					                    ret_rules_by_user, missing_member_event_ids, state_group, event
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
 | 
					                # The push rules didn't change but lets update the cache anyway
 | 
				
			||||||
 | 
					                self.update_cache(
 | 
				
			||||||
 | 
					                    self.sequence,
 | 
				
			||||||
 | 
					                    members={},  # There were no membership changes
 | 
				
			||||||
 | 
					                    rules_by_user=ret_rules_by_user,
 | 
				
			||||||
 | 
					                    state_group=state_group
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if logger.isEnabledFor(logging.DEBUG):
 | 
					        if logger.isEnabledFor(logging.DEBUG):
 | 
				
			||||||
            logger.debug(
 | 
					            logger.debug(
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user