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

  • added customer (with address and phone), invoices, payments to old and existing invoices.
  • ran sync from Dashboard

  • Dashboard counts
  • Account.current.xero_synchronizing = true : Dash sync is not returning xero_sync'ing to false
  • reloading the Dashboard, counters have not gone down
  • Account.current.xero_syncs.last is not the current sync !!! ... the current sync hasn't been created
  • main xero.log has logged that the sync has been completed
  • the Customer.last.xero_id = nil
  • the Invoice.last.xero_id = nil
  • no Resque error

@mixmix
Copy link
Author

mixmix commented Sep 25, 2014

running sync on App Server worked apart from Customer

-need to check if customer phone / address is initially synced : it was sync'd on the first sync

@mixmix
Copy link
Author

mixmix commented Sep 25, 2014

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 to xero_synchronizing = false , and no xero_entities have been created.

have reverter to Utility doing xero_jobs

@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