From 291a098c111ff419506094e14c0186389b0020ca Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Tue, 5 Apr 2016 06:11:28 +0930 Subject: Directly support stateful executor hooks Also, make sure to call the +complete+ hooks if +run+ fails. --- activesupport/lib/active_support/reloader.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/reloader.rb') diff --git a/activesupport/lib/active_support/reloader.rb b/activesupport/lib/active_support/reloader.rb index 5d1f0e1e66..5623bdd349 100644 --- a/activesupport/lib/active_support/reloader.rb +++ b/activesupport/lib/active_support/reloader.rb @@ -43,7 +43,13 @@ module ActiveSupport # Initiate a manual reload def self.reload! executor.wrap do - new.tap(&:run!).complete! + new.tap do |instance| + begin + instance.run! + ensure + instance.complete! + end + end end prepare! end -- cgit v1.2.3