Class: Paradeiser::Scheduler
- Inherits:
-
Object
- Object
- Paradeiser::Scheduler
- Extended by:
- Executor
- Defined in:
- lib/paradeiser/models/scheduler.rb
Constant Summary
Constants included from Executor
Class Method Summary collapse
Methods included from Executor
Class Method Details
.add(command, minutes) ⇒ Object
19 20 21 22 23 |
# File 'lib/paradeiser/models/scheduler.rb', line 19 def add(command, minutes) _, err = exec("echo #{BIN_PAR} #{command} | #{at} -q #{queue} now + #{minutes} minutes") id = parse_add(err.chomp) Job.new(id) end |
.clear ⇒ Object
25 26 27 28 29 30 |
# File 'lib/paradeiser/models/scheduler.rb', line 25 def clear if list.any? # On Linux, at must not be called with an empty job list. job_ids = list.map{|j| j.id}.join(' ') exec("#{at} -q #{queue} -r #{job_ids}") end end |