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.
orbit-4-1/app/jobs/sync_db.rb

26 lines
630 B
Ruby

class SyncDb
@queue = :high
def self.perform()
puts "[ #{DateTime.now.strftime("%Y %D %H:%M") }]\t SyncDb Starting"
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 "[#{ DateTime.now.strftime("%Y %D %H:%M")}]\tSyncDb Synced"
end
def self.set_admin
task = 'mid_site:install_admin'
args = []
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]\tAdmin done"
end
end