Listing Scheduled Jobs in Sidekiq (within code)

Why doesn’t this work?

NB this was asked before but no explanation was provided

Specifically on a Production instance, size returns zero from rails console despite there being plenty of Scheduled jobs?:

(from the official API docs)

ss = Sidekiq::ScheduledSet.new
ss.size

returns a big fat zero :thinking:

That does work, but it will list the jobs that are shown in /sidekiq/scheduled, not in /sidekiq/scheduler

You probably want to do this

MiniScheduler::Manager.discover_schedules.each do |j|
  puts j
end
2 Likes

Gah yes, thanks!

1 Like