mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-04 10:34:05 +00:00 
			
		
		
		
	autopkgtest: Publish AMQP messages persistently
We want to ask the broker to write them out to disk, hoepfully mitigating against it crashing.
This commit is contained in:
		
							parent
							
								
									2623053f82
								
							
						
					
					
						commit
						b2e863fd6f
					
				@ -952,7 +952,9 @@ class AutopkgtestPolicy(BasePolicy):
 | 
				
			|||||||
        params = json.dumps(params)
 | 
					        params = json.dumps(params)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.amqp_channel:
 | 
					        if self.amqp_channel:
 | 
				
			||||||
            self.amqp_channel.basic_publish(amqp.Message(src + '\n' + params), routing_key=qname)
 | 
					            self.amqp_channel.basic_publish(amqp.Message(src + '\n' + params,
 | 
				
			||||||
 | 
					                                                         delivery_mode=2),  # persistent
 | 
				
			||||||
 | 
					                                            routing_key=qname)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            assert self.amqp_file
 | 
					            assert self.amqp_file
 | 
				
			||||||
            with open(self.amqp_file, 'a') as f:
 | 
					            with open(self.amqp_file, 'a') as f:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user