Class: Taskit

Inherits:
Object
  • Object
show all
Defined in:
lib/taskit.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) run_scheduled_tasks

note: we can send output to the standard output (puts) and the cron job should send it to the scheduled_tasks.log file :)



14
15
16
17
18
19
20
21
22
23
# File 'lib/taskit.rb', line 14

def self.run_scheduled_tasks 

  now = Time.now.utc
  
  puts "**** Starting processing scheduled tasks at: " +  now.to_s + " ****" 
  scheduled_tasks = ScheduledTask.find(:all)  
  scheduled_tasks.each do |scheduled_task|
    self.run_scheduled_task(scheduled_task, now)
  end  
end