From 3be0f959e3b29561ef19f5c7940256fe6316cd33 Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 15 May 2006 21:14:42 +0000 Subject: Wrapping the host storage into a transaction. It might have a slight performance improvement, but, ah, unlikely. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1200 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/parser/interpreter.rb | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 9bc1cca43..8ce85a666 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -268,21 +268,27 @@ module Puppet fork { # We store all of the objects, even the collectable ones benchmark(:info, "Stored configuration for #{client}") do + # Try to batch things a bit, by putting them into + # a transaction + Puppet::Rails::Host.transaction do + Puppet::Rails::Host.store( + :objects => objects, + :host => client, + :facts => facts + ) + end + end + } + else + # We store all of the objects, even the collectable ones + benchmark(:info, "Stored configuration for #{client}") do + Puppet::Rails::Host.transaction do Puppet::Rails::Host.store( :objects => objects, :host => client, :facts => facts ) end - } - else - # We store all of the objects, even the collectable ones - benchmark(:info, "Stored configuration for #{client}") do - Puppet::Rails::Host.store( - :objects => objects, - :host => client, - :facts => facts - ) end end -- cgit