lib/sidekiq/web/helpers.rb in sidekiq-7.0.1 vs lib/sidekiq/web/helpers.rb in sidekiq-7.0.2

- old
+ new

@@ -135,11 +135,11 @@ string % options end end def sort_direction_label - params[:direction] == "asc" ? "&uarr;" : "&darr;" + (params[:direction] == "asc") ? "&uarr;" : "&darr;" end def workset @work ||= Sidekiq::WorkSet.new end @@ -165,11 +165,11 @@ @stats ||= Sidekiq::Stats.new end def redis_url Sidekiq.redis do |conn| - conn._config.server_url + conn.config.server_url end end def redis_info Sidekiq.default_configuration.redis_info @@ -182,11 +182,11 @@ def current_path @current_path ||= request.path_info.gsub(/^\//, "") end def current_status - workset.size == 0 ? "idle" : "active" + (workset.size == 0) ? "idle" : "active" end def relative_time(time) stamp = time.getutc.iso8601 %(<time class="ltr" dir="ltr" title="#{stamp}" datetime="#{stamp}">#{time}</time>) @@ -215,11 +215,11 @@ SAFE_QPARAMS.include?(key) ? "#{key}=#{CGI.escape(value.to_s)}" : next }.compact.join("&") end def truncate(text, truncate_after_chars = 2000) - truncate_after_chars && text.size > truncate_after_chars ? "#{text[0..truncate_after_chars]}..." : text + (truncate_after_chars && text.size > truncate_after_chars) ? "#{text[0..truncate_after_chars]}..." : text end def display_args(args, truncate_after_chars = 2000) return "Invalid job payload, args is nil" if args.nil? return "Invalid job payload, args must be an Array, not #{args.class.name}" unless args.is_a?(Array) @@ -322,10 +322,10 @@ def server_utc_time Time.now.utc.strftime("%H:%M:%S UTC") end def pollable? - !(current_path == "" || current_path.starts_with?("metrics")) + !(current_path == "" || current_path.start_with?("metrics")) end def retry_or_delete_or_kill(job, params) if params["retry"] job.retry