lib/sidekiq/web/application.rb in sidekiq-7.2.2 vs lib/sidekiq/web/application.rb in sidekiq-7.2.3

- old
+ new

@@ -47,13 +47,13 @@ # nothing, backwards compatibility end head "/" do # HEAD / is the cheapest heartbeat possible, - # it hits Redis to ensure connectivity - Sidekiq.redis { |c| c.llen("queue:default") } - "" + # it hits Redis to ensure connectivity and returns + # the size of the default queue + Sidekiq.redis { |c| c.llen("queue:default") }.to_s end get "/" do @redis_info = redis_info.select { |k, v| REDIS_KEYS.include? k } days = (params["days"] || 30).to_i @@ -390,9 +390,21 @@ x = params[:substr] return redirect "#{root_path}morgue" unless x && x != "" @dead = search(Sidekiq::DeadSet.new, params[:substr]) erb :morgue + end + + post "/change_locale" do + locale = params["locale"] + + match = available_locales.find { |available| + locale == available + } + + session[:locale] = match if match + + reload_page end def call(env) action = self.class.match(env) return [404, {Rack::CONTENT_TYPE => "text/plain", Web::X_CASCADE => "pass"}, ["Not Found"]] unless action