aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/reloader.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-04-05 06:11:28 +0930
committerMatthew Draper <matthew@trebex.net>2016-04-05 06:57:01 +0930
commit291a098c111ff419506094e14c0186389b0020ca (patch)
tree314ffa2a9fe18d130bdd929afe6350abc8539841 /activesupport/lib/active_support/reloader.rb
parentbd49325e3ba9fba3bbea2d32b3e7a71ec1934c55 (diff)
downloadrails-291a098c111ff419506094e14c0186389b0020ca.tar.gz
rails-291a098c111ff419506094e14c0186389b0020ca.tar.bz2
rails-291a098c111ff419506094e14c0186389b0020ca.zip
Directly support stateful executor hooks
Also, make sure to call the +complete+ hooks if +run+ fails.
Diffstat (limited to 'activesupport/lib/active_support/reloader.rb')
-rw-r--r--activesupport/lib/active_support/reloader.rb8
1 files changed, 7 insertions, 1 deletions
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