Last active
December 20, 2015 00:08
-
-
Save christopher-b/6038992 to your computer and use it in GitHub Desktop.
Canvas LMS rake task to return the number of queued delayed jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :ocadu do | |
"Returns the number of delayed jobs in the queue" | |
task :job_count => :environment do | |
puts Delayed::Job.where("run_at < UTC_TIMESTAMP() AND locked_at is null").count | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BTW, I think for MySQL the query should be: