Class: Anomonitor::Jobs::Browsers::Sidekiq

Inherits:
Object
  • Object
show all
Defined in:
lib/anomonitor/jobs/browsers/sidekiq.rb

Constant Summary collapse

PER_SET =
50

Instance Method Summary collapse

Instance Method Details

#fetch(filters) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/anomonitor/jobs/browsers/sidekiq.rb', line 13

def fetch(filters)
  unless defined?(::Sidekiq)
    Anomonitor.logger.warn("[Anomonitor] Jobs browser skipped sidekiq: Sidekiq not loaded")
    return []
  end

  status = filters[:status]
  rows = []
  rows.concat(pending_rows(filters)) if status == "all" || status == "pending"
  rows.concat(locked_rows(filters)) if status == "all" || status == "locked"
  rows.concat(failed_rows(filters)) if status == "all" || status == "failed"
  rows
rescue StandardError => e
  Anomonitor.logger.warn("[Anomonitor] Sidekiq jobs browser error: #{e.message}")
  []
end

#source_keyObject



9
10
11
# File 'lib/anomonitor/jobs/browsers/sidekiq.rb', line 9

def source_key
  "sidekiq"
end