This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
2012-05-08 03:31:35 +00:00
|
|
|
class SyncDb
|
|
|
|
|
|
|
|
@queue = :high
|
|
|
|
|
|
|
|
def self.perform()
|
2012-07-03 02:51:26 +00:00
|
|
|
puts "[ #{DateTime.now.strftime("%Y %D %H:%M") }]\t SyncDb Starting"
|
2012-05-09 05:58:19 +00:00
|
|
|
self.start_sync
|
2012-05-24 09:01:00 +00:00
|
|
|
self.set_admin
|
2012-05-09 05:58:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.start_sync
|
|
|
|
task = 'mid_site:sync'
|
|
|
|
args = []
|
|
|
|
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
|
2012-05-22 09:57:45 +00:00
|
|
|
User.all.each{|ur| ur.create_dept_cache}
|
2012-07-03 02:51:26 +00:00
|
|
|
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]\tSyncDb Synced"
|
2012-05-08 03:31:35 +00:00
|
|
|
end
|
2012-05-24 09:01:00 +00:00
|
|
|
|
|
|
|
def self.set_admin
|
|
|
|
task = 'mid_site:install_admin'
|
|
|
|
args = []
|
|
|
|
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
|
2012-07-03 02:51:26 +00:00
|
|
|
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]\tAdmin done"
|
2012-05-24 09:01:00 +00:00
|
|
|
end
|
2012-05-08 03:31:35 +00:00
|
|
|
end
|