Skip to content

Instantly share code, notes, and snippets.

@radar
Forked from anonymous/background_job_checker.rb
Last active December 12, 2015 03:48
Show Gist options
  • Save radar/4709334 to your computer and use it in GitHub Desktop.
Save radar/4709334 to your computer and use it in GitHub Desktop.
class BackgroundJobChecker
def self.check
Resque::Plugins::Status::Hash.statuses.each do |job|
return !job.working?
end
end
end
require "background_job_checker"
class Device < ActiveRecord::Base
before_create :check_background_job
def check_background_job
BackgroundJobChecker::check
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment