lib/rack/stackflame.rb in stackflame-0.2.4 vs lib/rack/stackflame.rb in stackflame-0.2.5

- old
+ new

@@ -14,16 +14,17 @@ end def call(env) result = nil - stackflame = ::Stackflame.new - stackflame.run(@options) do - result = @app.call(env) - end - if @block.call(env) + stackflame = ::Stackflame.new + stackflame.run(@options) do + result = @app.call(env) + end stackflame.open_flamegraph(request: env['PATH_INFO']) + else + result = @app.call(env) end result end