Sha256: 77460b53f672bbfb0d0448764b9cd139d26fd05fbf0e929e7629eb1b96799ff4
Contents?: true
Size: 669 Bytes
Versions: 14
Compression:
Stored size: 669 Bytes
Contents
# frozen_string_literal: true require 'rails_autoscale_agent/store' require 'rails_autoscale_agent/reporter' require 'rails_autoscale_agent/config' require 'rails_autoscale_agent/request' module RailsAutoscaleAgent class Middleware def initialize(app) @app = app end def call(env) config = Config.instance request = Request.new(env, config) store = Store.instance Reporter.start(config, store) if !request.ignore? && queue_time = request.queue_time # NOTE: Expose queue time to the app env['queue_time'] = queue_time store.push queue_time end @app.call(env) end end end
Version data entries
14 entries across 14 versions & 1 rubygems