Created
September 25, 2014 03:25
-
-
Save mixmix/5ede408dae22b603d872 to your computer and use it in GitHub Desktop.
run sync_all & log to specific file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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
Tried changing the App/ Utility queues so that xero sync job was picked up on App Server (changed resque_*.conf files, restarted workers with monit)
result: exactly the same behaviour as when Utility server picked up job: logger logs action, including
SYNC COMPLETE !
message, but then fails to update account toxero_synchronizing = false
, and no xero_entities have been created.have reverter to Utility doing xero_jobs