summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@reductivelabs.com>2010-03-22 16:42:03 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit5aa26d08892010fc62de6adc278f07c8748d75e0 (patch)
tree237ab3c0f09ab8ef42ef1b98efb4847f70382baf /lib/puppet
parentec7ea27e356dc159b37cc2a09b6f14841e796ab2 (diff)
downloadpuppet-5aa26d08892010fc62de6adc278f07c8748d75e0.tar.gz
puppet-5aa26d08892010fc62de6adc278f07c8748d75e0.tar.xz
puppet-5aa26d08892010fc62de6adc278f07c8748d75e0.zip
Changing method profile for other event queueing
It wasn't clear in the first refactor if this was necessary, but doing the performance optimization made it clear it was. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/transaction/event_manager.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/puppet/transaction/event_manager.rb b/lib/puppet/transaction/event_manager.rb
index 24e577803..9c5c166c4 100644
--- a/lib/puppet/transaction/event_manager.rb
+++ b/lib/puppet/transaction/event_manager.rb
@@ -51,23 +51,21 @@ class Puppet::Transaction::EventManager
next unless method = edge.callback
next unless edge.target.respond_to?(method)
- list.each do |e|
- queue_event_for_resource(resource, edge.target, method, e)
- end
+ queue_events_for_resource(resource, edge.target, method, list)
end
if resource.self_refresh? and ! resource.deleting?
- queue_event_for_resource(resource, resource, :refresh, event)
+ queue_events_for_resource(resource, resource, :refresh, [event])
end
end
end
- def queue_event_for_resource(source, target, callback, event)
+ def queue_events_for_resource(source, target, callback, events)
source.info "Scheduling #{callback} of #{target}"
@event_queues[target] ||= {}
@event_queues[target][callback] ||= []
- @event_queues[target][callback] << event
+ @event_queues[target][callback] += events
end
def queued_events(resource)