1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Update to latest standardrb, fix style issues

This commit is contained in:
Mike Perham 2019-08-28 10:13:41 -07:00
parent 48fd615e09
commit 978ce8e6cf
8 changed files with 20 additions and 20 deletions

2
.gitignore vendored
View file

@ -1,7 +1,7 @@
.rvmrc
.ruby-version
tags
gemfiles/*.lock
Gemfile.lock
*.swp
dump.rdb
.rbx

View file

@ -119,7 +119,7 @@ module Sidekiq
end
rescue Redis::CommandError => ex
# 2850 return fake version when INFO command has (probably) been renamed
raise unless ex.message =~ /unknown command/
raise unless /unknown command/.match?(ex.message)
FAKE_INFO
end
end

View file

@ -93,7 +93,7 @@ module Sidekiq
s = processes.size
workers_size = pipe2_res[0...s].map(&:to_i).inject(0, &:+)
enqueued = pipe2_res[s..-1].map(&:to_i).inject(0, &:+)
enqueued = pipe2_res[s..-1].map(&:to_i).inject(0, &:+)
default_queue_latency = if (entry = pipe1_res[6].first)
job = begin
@ -122,7 +122,7 @@ module Sidekiq
end
def reset(*stats)
all = %w[failed processed]
all = %w[failed processed]
stats = stats.empty? ? all : all & stats.flatten.compact.map(&:to_s)
mset_args = []
@ -274,7 +274,7 @@ module Sidekiq
loop do
range_start = page * page_size - deleted_size
range_end = range_start + page_size - 1
range_end = range_start + page_size - 1
entries = Sidekiq.redis { |conn|
conn.lrange @rname, range_start, range_end
}
@ -563,7 +563,7 @@ module Sidekiq
loop do
range_start = page * page_size + offset_size
range_end = range_start + page_size - 1
range_end = range_start + page_size - 1
elements = Sidekiq.redis { |conn|
conn.zrange name, range_start, range_end, with_scores: true
}

View file

@ -140,7 +140,7 @@ module Sidekiq
def initialize(klass, *args)
@klass = klass
@args = args
@args = args
end
def make_new

View file

@ -126,7 +126,7 @@ module Sidekiq
# the Reloader. It handles code loading, db connection management, etc.
# Effectively this block denotes a "unit of work" to Rails.
@reloader.call do
klass = constantize(job_hash["class"])
klass = constantize(job_hash["class"])
worker = klass.new
worker.jid = job_hash["jid"]
@retrier.local(worker, pristine, queue) do

View file

@ -257,7 +257,7 @@ module Sidekiq
get "/stats" do
sidekiq_stats = Sidekiq::Stats.new
redis_stats = redis_info.select { |k, v| REDIS_KEYS.include? k }
redis_stats = redis_info.select { |k, v| REDIS_KEYS.include? k }
json(
sidekiq: {
processed: sidekiq_stats.processed,

View file

@ -84,7 +84,7 @@ module Sidekiq
languages = env["HTTP_ACCEPT_LANGUAGE"]
languages.to_s.downcase.gsub(/\s+/, "").split(",").map { |language|
locale, quality = language.split(";q=", 2)
locale = nil if locale == "*" # Ignore wildcards
locale = nil if locale == "*" # Ignore wildcards
quality = quality ? quality.to_f : 1.0
[locale, quality]
}.sort { |(_, left), (_, right)|

View file

@ -1,17 +1,17 @@
require_relative "lib/sidekiq/version"
Gem::Specification.new do |gem|
gem.authors = ["Mike Perham"]
gem.email = ["mperham@gmail.com"]
gem.summary = "Simple, efficient background processing for Ruby"
gem.description = "Simple, efficient background processing for Ruby."
gem.homepage = "http://sidekiq.org"
gem.license = "LGPL-3.0"
gem.authors = ["Mike Perham"]
gem.email = ["mperham@gmail.com"]
gem.summary = "Simple, efficient background processing for Ruby"
gem.description = "Simple, efficient background processing for Ruby."
gem.homepage = "http://sidekiq.org"
gem.license = "LGPL-3.0"
gem.executables = ["sidekiq"]
gem.files = `git ls-files | grep -Ev '^(test|myapp|examples)'`.split("\n")
gem.name = "sidekiq"
gem.version = Sidekiq::VERSION
gem.executables = ["sidekiq"]
gem.files = `git ls-files | grep -Ev '^(test|myapp|examples)'`.split("\n")
gem.name = "sidekiq"
gem.version = Sidekiq::VERSION
gem.required_ruby_version = ">= 2.5.0"
gem.add_dependency "redis", ">= 4.1.0"