diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-15 21:14:42 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-15 21:14:42 +0000 |
commit | 3be0f959e3b29561ef19f5c7940256fe6316cd33 (patch) | |
tree | d2bba19bb8e79a5199598dbb9c7aaec19bda6f8a /lib/puppet/parser/interpreter.rb | |
parent | 9d6166e964d188fb0c9232413d9da41f15fd1bf4 (diff) | |
download | puppet-3be0f959e3b29561ef19f5c7940256fe6316cd33.tar.gz puppet-3be0f959e3b29561ef19f5c7940256fe6316cd33.tar.xz puppet-3be0f959e3b29561ef19f5c7940256fe6316cd33.zip |
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
Diffstat (limited to 'lib/puppet/parser/interpreter.rb')
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 24 |
1 files changed, 15 insertions, 9 deletions
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 |