Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Add timeouts and an enable/disable switch #16

Merged

Conversation

jordan-brough
Copy link
Contributor

PR for #15.

cc @magnusvk

Wasn't being used and slows things down.
Store these configs in the database so that they can be applied
to all app servers instantly and without restarting.
@jordan-brough
Copy link
Contributor Author

Note: Having the enable/disable switch inside of solidus_avatax in this way feels a bit weird to me, but I'm OK with it if others are. I could also see us just trying to make it really easy to add your own enable/disable logic inside of the applications themselves if people thought that was better.

tax_svc.canceltax(params)
end
end

def tax_svc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this become private?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah it could but I was thinking it's probably nice to be able to access this from a console & etc, or from custom code if someone using Avatax is using an endpoint that we're not covering.

@athal7
Copy link
Contributor

athal7 commented Dec 1, 2015

looking good to me! and nice cleanups along the way.

@@ -11,6 +13,17 @@ class << self
attr_accessor :sales_invoice_generate_error_handler
attr_accessor :sales_invoice_commit_error_handler
attr_accessor :sales_invoice_cancel_error_handler

def timeout
(config = last) ? config.timeout : DEFAULT_TIMEOUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes me just a tad uncomfortable to use last without an order. I know that this will order by id by default, but personally I'd love to be more explicit about this. Not a blocker, just a thought.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'm fine with adding a most_recent helper method or something like that.

@magnusvk
Copy link
Contributor

magnusvk commented Dec 1, 2015

Nice work, thank you. 👍

@jordan-brough
Copy link
Contributor Author

@cbrunsdon or @jhawthorn or @gmacdougall any thoughts on the general approach here before I start doing tweaks & cleanups?

More explicit name and more explicit order clause
And add some comments.
@jordan-brough
Copy link
Contributor Author

@magnusvk @athal7 I implemented some of those suggestions and refactored the timeout code a little bit. Good to go? Stembolt says they are fine with us managing solidus_avatax.

Explicitly focus the timeout code on Avatax API calls to discourage it
from being used for other purposes.
@magnusvk
Copy link
Contributor

👍 🚢 🇮🇹

jordan-brough added a commit that referenced this pull request Dec 18, 2015
…itch

Add timeouts and an enable/disable switch
@jordan-brough jordan-brough merged commit aabadf4 into solidusio:master Dec 18, 2015
@jordan-brough jordan-brough deleted the add-timeouts-and-disable-switch branch December 18, 2015 14:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants