Test version for DB sync schedule job
This commit is contained in:
		
							parent
							
								
									f827e8429e
								
							
						
					
					
						commit
						e4c41a9310
					
				| 
						 | 
				
			
			@ -3,7 +3,13 @@ class SyncDb
 | 
			
		|||
  @queue = :high
 | 
			
		||||
 | 
			
		||||
  def self.perform()
 | 
			
		||||
#    sleep 10
 | 
			
		||||
    puts "DB Sync"
 | 
			
		||||
    self.start_sync
 | 
			
		||||
  end
 | 
			
		||||
  
 | 
			
		||||
  def self.start_sync
 | 
			
		||||
    task = 'mid_site:sync'
 | 
			
		||||
    args = []
 | 
			
		||||
    %x[rake #{task} --trace  >> #{Rails.root}/log/rake.log]
 | 
			
		||||
    puts "SyncDb Synced"
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,4 +11,4 @@ mid_host = {
 | 
			
		|||
  :database => "RSS23_NCCU_MIDDLE",
 | 
			
		||||
  :encoding => "UTF8"
 | 
			
		||||
}
 | 
			
		||||
#MID_CLIENT = Mysql2::Client.new(mid_host)
 | 
			
		||||
MID_CLIENT = Mysql2::Client.new(mid_host)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,17 +1,17 @@
 | 
			
		|||
do_mail_matt:
 | 
			
		||||
  every: 10s
 | 
			
		||||
  class: FetchTime
 | 
			
		||||
  args: 
 | 
			
		||||
  description: Runs the perform method in FetchTime
 | 
			
		||||
# do_mail_matt:
 | 
			
		||||
#   every: 10s
 | 
			
		||||
#   class: FetchTime
 | 
			
		||||
#   args: 
 | 
			
		||||
#   description: Runs the perform method in FetchTime
 | 
			
		||||
 | 
			
		||||
nccu_daily_ldap_sync:
 | 
			
		||||
  cron: * * [0,12] * * *
 | 
			
		||||
  class: SyncDb
 | 
			
		||||
  args:
 | 
			
		||||
  description: Runs the perform method in SnycDB
 | 
			
		||||
  description: Sync NCCU middle site with Orbit for LDAP data
 | 
			
		||||
 | 
			
		||||
nccu_claender_sync:
 | 
			
		||||
  every: 1m
 | 
			
		||||
  cron: * * [0,12] * * *
 | 
			
		||||
  class: NccuCalendar
 | 
			
		||||
  args:
 | 
			
		||||
  description: Runs the perform method in NccuCalendar
 | 
			
		||||
  description: Sync NCCU calendar RSS Feeds
 | 
			
		||||
| 
						 | 
				
			
			@ -2,6 +2,7 @@
 | 
			
		|||
# require 'ruby-debug'
 | 
			
		||||
 | 
			
		||||
namespace :mid_site do
 | 
			
		||||
  desc "mid_site Rake task"
 | 
			
		||||
  attr_from_mid = %w{nccu_id psn_nam ut_cod up_ut_cod eml_adr off_tel_ext sta_num}
 | 
			
		||||
  officer_posgrp_code = %w{02 06 10 05} #from RSS2 
 | 
			
		||||
  admin_role = nil
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue