25 lines
469 B
Ruby
25 lines
469 B
Ruby
class SyncDb
|
|
|
|
@queue = :high
|
|
|
|
def self.perform()
|
|
self.start_sync
|
|
self.set_admin
|
|
end
|
|
|
|
def self.start_sync
|
|
task = 'mid_site:sync'
|
|
args = []
|
|
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
|
|
User.all.each{|ur| ur.create_dept_cache}
|
|
puts "SyncDb Synced"
|
|
end
|
|
|
|
def self.set_admin
|
|
task = 'mid_site:install_admin'
|
|
args = []
|
|
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
|
|
puts "Admin done"
|
|
end
|
|
end
|