Skip to content

Commit

Permalink
Merge pull request #628 from bruz/code-reloading-fix
Browse files Browse the repository at this point in the history
Skip preloading when code reloading is enabled
  • Loading branch information
jodosha committed Aug 9, 2016
2 parents 85bb146 + ee138a6 commit 50b423f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/hanami/commands/server.rb
Expand Up @@ -78,7 +78,7 @@ def prepare_server!
# @see Hanami::Environment::CODE_RELOADING
def detect_strategy!
@strategy = :rackup
if Hanami::Environment.new(@options).code_reloading?
if code_reloading?
if shotgun_enabled?
if fork_supported?
@strategy = :shotgun
Expand All @@ -95,7 +95,17 @@ def detect_strategy!

def preload_applications!
Hanami::Environment.new(@options).require_application_environment
Hanami::Application.preload!
Hanami::Application.preload! unless code_reloading?
end

# Check if code reloading is enabled
#
# @return [Boolean]
#
# @since 0.?.?
# @api private
def code_reloading?
Hanami::Environment.new(@options).code_reloading?
end

# Check if entr(1) is installed
Expand Down

0 comments on commit 50b423f

Please sign in to comment.