File size: 361 Bytes
def1299
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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"
        IsolateRunner.perform_now(s)
      else
        IsolateRunner.perform_later(s)
      end
    end
  end
end