summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-15 21:14:42 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-15 21:14:42 +0000
commit3be0f959e3b29561ef19f5c7940256fe6316cd33 (patch)
treed2bba19bb8e79a5199598dbb9c7aaec19bda6f8a /lib/puppet/parser
parent9d6166e964d188fb0c9232413d9da41f15fd1bf4 (diff)
downloadpuppet-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')
-rw-r--r--lib/puppet/parser/interpreter.rb24
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