Skip to content
Browse files

fix Syntax error with ruby 1.8.7: models/dj_mon/djreport.rb

  • Loading branch information...
1 parent e4a0dbc commit d822ca19153b684d76734423cfbfcdcd1aa621c2 @wanglian wanglian committed Sep 22, 2012
Showing with 23 additions and 23 deletions.
  1. +23 −23 app/models/dj_mon/dj_report.rb
View
46 app/models/dj_mon/dj_report.rb
@@ -10,17 +10,17 @@ def initialize delayed_job
def as_json(options={})
{
- id: delayed_job.id,
- payload: payload(delayed_job),
- priority: delayed_job.priority,
- attempts: delayed_job.attempts,
- queue: delayed_job.queue || "global",
- last_error_summary: delayed_job.last_error.to_s.truncate(30),
- last_error: delayed_job.last_error,
- failed_at: l_datetime(delayed_job.failed_at),
- run_at: l_datetime(delayed_job.run_at),
- created_at: l_datetime(delayed_job.created_at),
- failed: delayed_job.failed_at.present?
+ :id => delayed_job.id,
+ :payload => payload(delayed_job),
+ :priority => delayed_job.priority,
+ :attempts => delayed_job.attempts,
+ :queue => delayed_job.queue || "global",
+ :last_error_summary => delayed_job.last_error.to_s.truncate(30),
+ :last_error => delayed_job.last_error,
+ :failed_at => l_datetime(delayed_job.failed_at),
+ :run_at => l_datetime(delayed_job.run_at),
+ :created_at => l_datetime(delayed_job.created_at),
+ :failed => delayed_job.failed_at.present?
}
end
@@ -51,23 +51,23 @@ def queued_reports
def dj_counts
{
- all: DjMon::Backend.all.size,
- failed: DjMon::Backend.failed.size,
- active: DjMon::Backend.active.size,
- queued: DjMon::Backend.queued.size
+ :all => DjMon::Backend.all.size,
+ :failed => DjMon::Backend.failed.size,
+ :active => DjMon::Backend.active.size,
+ :queued => DjMon::Backend.queued.size
}
end
def settings
{
- destroy_failed_jobs: Delayed::Worker.destroy_failed_jobs,
- sleep_delay: Delayed::Worker.sleep_delay,
- max_attempts: Delayed::Worker.max_attempts,
- max_run_time: Delayed::Worker.max_run_time,
- read_ahead: defined?(Delayed::Worker.read_ahead) ? Delayed::Worker.read_ahead : 5,
- delay_jobs: Delayed::Worker.delay_jobs,
- delayed_job_version: Gem.loaded_specs["delayed_job"].version.version,
- dj_mon_version: DjMon::VERSION
+ :destroy_failed_jobs => Delayed::Worker.destroy_failed_jobs,
+ :sleep_delay => Delayed::Worker.sleep_delay,
+ :max_attempts => Delayed::Worker.max_attempts,
+ :max_run_time => Delayed::Worker.max_run_time,
+ :read_ahead => defined?(Delayed::Worker.read_ahead) ? Delayed::Worker.read_ahead : 5,
+ :delay_jobs => Delayed::Worker.delay_jobs,
+ :delayed_job_version => Gem.loaded_specs["delayed_job"].version.version,
+ :dj_mon_version => DjMon::VERSION
}
end
end

0 comments on commit d822ca1

Please sign in to comment.
Something went wrong with that request. Please try again.