God , Resque, Resque-schedule, is working,but buggy. Need to combine with LDAP and also implement XML calendar sync.

This commit is contained in:
Matthew K. Fu JuYuan authored and Christophe Vilayphiou committed 2012-05-08 20:21:28 +08:00
1 parent 69f2f6a716
commit f949523bbb
11 files changed
+104 -10

No files matched your search

+8 -6
View File
@@ -1,13 +1,15 @@
# require 'open-uri'
# require 'nokogiri'
module FetchTime
@queue = :my_job_queue
class FetchTime < Resque::Plugins::RestrictionJob
restrict :per_300 => 10
@queue = :low
def self.perform()
# sleep 10
# doc = Nokogiri::HTML(open('http://www.timeanddate.com/worldclock/city.html?n=241'))
# CronMail.time_check(doc.at('#ct').children.first.text).deliver
# puts "Mail Sent"
# true
doc = Nokogiri::HTML(open('http://www.timeanddate.com/worldclock/city.html?n=241'))
CronMail.time_check(doc.at('#ct').children.first.text).deliver
puts "Mail Sent"
true
end
end
+8
View File
@@ -0,0 +1,8 @@
class NccuCalendar
@queue = :high
def self.perform()
# sleep 10
puts "NccuCalendar Sync"
end
end
+9
View File
@@ -0,0 +1,9 @@
class SyncDb
@queue = :high
def self.perform()
# sleep 10
puts "DB Sync"
end
end