Skip to content

Commit

Permalink
Add rake task for manually running submissions in queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanzdosilovic committed Oct 1, 2020
1 parent be300ef commit c3b87d2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/tasks/run_submissions_in_queue.rake
@@ -0,0 +1,14 @@
desc "Run all submission with status 'In Queue'."

namespace :judge0 do
task :run_in_queue => :environment do
ARGV.each { |a| task a.to_sym do ; end }
Submission.where(status_id: Status.queue).each do |s|
if ARGV[1].to_s == "now"
IsolateJob.perform_now(s)
else
IsolateJob.perform_later(s)
end
end
end
end

0 comments on commit c3b87d2

Please sign in to comment.