Skip to content

Instantly share code, notes, and snippets.

@mixmix
Created September 25, 2014 03:25
Show Gist options
  • Save mixmix/5ede408dae22b603d872 to your computer and use it in GitHub Desktop.
Save mixmix/5ede408dae22b603d872 to your computer and use it in GitHub Desktop.
run sync_all & log to specific file
subdomain = 'nzdemo1'
Storey.switch subdomain
account = Account.current
owner = account.owner
custom_log_name = "xero-mix-#{subdomain}"
custom_logger = Xero::Logger.new "#{Rails.root}/log/#{custom_log_name}.log"
custom_connection = Xero::Connection.new owner, Xero::ApplicationFactory.new, custom_logger
xs = Xero::Service.new owner, connection: custom_connection
xs.renew_xero_token
xs.sync_all
@mixmix
Copy link
Author

mixmix commented Sep 25, 2014

Note there are two redis things running in sudo monit summary on App Server :

The Monit daemon 5.0.3 uptime: 2d 16h 36m 

Process 'resque_SpannerPlanner_0'   running
Process 'resque_SpannerPlanner_1'   running
Process 'redis-1'                   running
Process 'redis'                     not monitored
Process 'nrsysmond'                 running
Process 'mini_httpd'                running
Process 'memcache_11211'            running
System 'domU-12-31-39-03-4D-73'     running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment