Class: Sidekiq::Mcp::Tools::DeadJobsTool
- Inherits:
-
Sidekiq::Mcp::Tool
- Object
- Sidekiq::Mcp::Tool
- Sidekiq::Mcp::Tools::DeadJobsTool
- Defined in:
- lib/sidekiq/mcp/tools/dead_jobs_tool.rb
Instance Method Summary collapse
Methods inherited from Sidekiq::Mcp::Tool
arguments, #call, description, schema_to_json_schema, to_tool_definition
Instance Method Details
#perform(limit: 10) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sidekiq/mcp/tools/dead_jobs_tool.rb', line 16 def perform(limit: 10) jobs = Sidekiq::DeadSet.new.first(limit).map do |job| { jid: job.jid, class: job.klass, args: job.args, queue: job.queue, error_message: job["error_message"], error_class: job["error_class"], failed_at: job["failed_at"], retry_count: job["retry_count"], died_at: job["died_at"] } end { total_size: Sidekiq::DeadSet.new.size, jobs: jobs }.to_json end |