Adds a job info page for scheduled jobs which doesn't truncate args#1076
Adds a job info page for scheduled jobs which doesn't truncate args#1076mperham merged 7 commits intosidekiq:masterfrom
Conversation
…scroll to let you see them.
|
Screenshot please. |
|
It looks similar in the other two places. |
|
I still think there needs to be a cutoff character count, just to keep the page from being 5MB if someone has large payloads. Maybe 2000? |
|
Yeah, I guess someone could have a huge payload. The page limits to 25, so the limit on args could be pretty high. Even at 20,000 characters, that's just shy of 500kb for the args, which I think is still acceptable. Thoughts on that? |
|
No, they can still click thru to the individual job page if they want to see the entire thing. 2k is more than reasonable for an overview. |
|
Ah, that could explain one of my problems. You can't click through to any jobs page for Scheduled Jobs. |
|
Sounds like your next PR then. :-) |
|
Yep! |
|
Though, is there a jobs page at all for scheduled jobs? I just shut down some workers to let jobs queue up and look at mysite.com/sidekiq/queues/default and there's a "Show All" button to expand the args, but not an individual page for an enqueued item. |
|
I believe Retries allow you to click thru - you would just do the same thing since Retries are just scheduled jobs. |
|
Okay, good to know it exists. I'll poke around tomorrow/this weekend probably. |
…which removed arg truncation from overview pages.
|
@mperham I've updated this to add a status page for scheduled jobs. I also upped the truncation to 2000 characters on the summary pages and display the full argument set on the status page. |
|
Great progress, you're missing tests for the new endpoints. Could you remove all your changes around data population in contributing.md and config.ru? I'd prefer to keep this PR focused on the functional change. |
|
Updated with tests. The config.ru file already had some commented out code which populates parts of the view before I made this PR; I did not remove it, I just reverted my changes. |
test/test_web.rb
Outdated
There was a problem hiding this comment.
Change this JID to 'shouldntexist' so its clear to the reader you're testing the 404 behavior.
There was a problem hiding this comment.
The parameters to look up a scheduled job should include the score so the lookup is O(logN) in Redis. Otherwise it's an O(N) operation.
There was a problem hiding this comment.
Updated the jid per your comment and added a score, too, so it's more clear.
The parameters to look up a scheduled job do include the score; in get "/scheduled/:key the line of code to look up a job is:
@job = Sidekiq::ScheduledSet.new.fetch(*parse_params(params['key'])).firstand in scheduled.slim, the link is generated using:
a href="#{root_path}scheduled/#{job_params(msg, score)}"== relative_time(Time.at(score))Let me know if I'm missing something here.
|
Nice work! |



Given the ease of this change, consider this the issue per Contributing.md.
The truncation of arguments at 100 characters in sidekiq-web makes it basically unusable for the scheduled jobs for me since our job classes are namespaced into modules and Moped::BSON::ObjectIds serialize themselves starting with
!ruby/object:Moped::BSON::ObjectIdwhich is more than 1/3 of the allotted space anyway.