lib/rack/unreloader.rb
# If the cooldown time has been passed, reload any application files that have changed.
# Call the app with the environment.
If the cooldown time has been passed, reload any application files that have changed.
Call the app with the environment.
If the cooldown time has been passed reload any application files that have changed . Call the app with the environment .
def call(env)
      if @cooldown && Time.now > @last + @cooldown
        begin
          MUTEX.synchronize{reload!}
        rescue StandardError, ScriptError => e
          raise unless @handle_reload_errors
          content = "#{e.class}: #{e}\n#{e.backtrace.join("\n")}"
          return [500, {'Content-Type' => 'text/plain', 'Content-Length' => content.bytesize.to_s}, [content]]
        end
        @last = Time.now
      end
      @app_block.call.call(env)
    end
def call ( env ) if @cooldown && Time . now > @last + @cooldown begin MUTEX . synchronize { reload! } rescue StandardError , ScriptError => e raise unless @handle_reload_errors content = "#{e.class}: #{e}\n#{e.backtrace.join("\n")}" return [ 500 , { 'Content-Type' => 'text/plain' , 'Content-Length' => content . bytesize . to_s } , [ content ] ] end @last = Time . now end @app_block . call . call ( env ) end
If the cooldown time has been passed, reload any application files that have changed.
If the cooldown time has been passed reload any application files that have changed .
env