Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mperham/sidekiq
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Aug 1, 2018
2 parents 173ce98 + 24ac099 commit 2929413
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Ent-Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.

HEAD
-------------

- Add support for sidekiqswarm memory monitoring on FreeBSD [#3884]

1.7.1
-------------

Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/web/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def job_params(job, score)
end

def parse_params(params)
score, jid = params.split("-")
score, jid = params.split("-", 2)
[score.to_f, jid]
end

Expand Down
12 changes: 9 additions & 3 deletions test/test_web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def perform(a, b)

post "/morgue/#{score}-", 'delete' => 'Delete'
assert_equal 302, last_response.status
assert_equal 0, s.size
assert_equal 1, s.size
end
end

Expand Down Expand Up @@ -515,6 +515,12 @@ def perform(a, b)
post "/morgue/#{job_params(*params)}", 'retry' => 'Retry'
assert_equal 302, last_response.status
assert_equal 'http://example.org/morgue', last_response.header['Location']
assert_equal 0, Sidekiq::DeadSet.new.size

params = add_dead('jid-with-hyphen')
post "/morgue/#{job_params(*params)}", 'retry' => 'Retry'
assert_equal 302, last_response.status
assert_equal 0, Sidekiq::DeadSet.new.size

get '/queues/foo'
assert_equal 200, last_response.status
Expand Down Expand Up @@ -556,15 +562,15 @@ def add_retry
[msg, score]
end

def add_dead
def add_dead(jid = SecureRandom.hex(12))
msg = { 'class' => 'HardWorker',
'args' => ['bob', 1, Time.now.to_f],
'queue' => 'foo',
'error_message' => 'Some fake message',
'error_class' => 'RuntimeError',
'retry_count' => 0,
'failed_at' => Time.now.utc,
'jid' => SecureRandom.hex(12) }
'jid' => jid }
score = Time.now.to_f
Sidekiq.redis do |conn|
conn.zadd('dead', score, Sidekiq.dump_json(msg))
Expand Down

0 comments on commit 2929413

Please sign in to comment.