Aucune description http://j1x-huginn.herokuapp.com

worker_status_controller.rb 527B

1234567891011121314
  1. class WorkerStatusController < ApplicationController
  2. skip_before_filter :authenticate_user!
  3. def show
  4. start = Time.now.to_f
  5. render :json => {
  6. :pending => Delayed::Job.where("run_at <= ? AND locked_at IS NULL AND attempts = 0", Time.now).count,
  7. :awaiting_retry => Delayed::Job.where("failed_at IS NULL AND attempts > 0").count,
  8. :recent_failures => Delayed::Job.where("failed_at IS NOT NULL AND failed_at > ?", 5.days.ago).count,
  9. :compute_time => Time.now.to_f - start
  10. }
  11. end
  12. end