Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DE country almost always return MS_MAX_CONCURRENT_REQ #129

Open
firstpromoter opened this issue Jan 24, 2024 · 4 comments
Open

DE country almost always return MS_MAX_CONCURRENT_REQ #129

firstpromoter opened this issue Jan 24, 2024 · 4 comments

Comments

@firstpromoter
Copy link

I know the error is not caused by this gem, but how we can handle this? VIES global limit for Germany is a joke, wondering if there's an alternative provider we can connect to?

@yolk
Copy link
Owner

yolk commented Jan 25, 2024

I am not aware of any alternative provider, and it IMO wouldn't make sense to offload/cache the data elsewhere; because the only authority in this regard are the official – and yes somewhat awkwardly limited – german servers.

So the only way to handle this is to simply keep retrying the request.

@momolog
Copy link

momolog commented Jan 20, 2025

So the only way to handle this is to simply keep retrying the request.

@yolk What would be the best way to do that when using valvat with Rails, i.e. like

  validates :vat_number, valvat: { lookup: true }

?
Is there a config option that retries the lookup after 5 seconds? Or can the validation be made pass when the rate limit is hit (I know, not good, but what is the alternative?).

@yolk
Copy link
Owner

yolk commented Jan 20, 2025

Moin @momolog,

the default behavior of the rails integration (and your code snippet) should validate to true if the web service is down (see the docs you mentioned). Does it behave differently in your case?

But I wouldn't recommend handling it this way. Instead I would store an new VAT-Number in the DB marked as :not_verified, and start validation it in a background job and mark it as :verified or :invalid when the web service is reachable. Valvat::Lookup.validate(record.vat_number) returns nil if the web service is down; so I would keep retrying it till you get an definitive answer back.

It is out of the scope of this gem to handle the background processing, sorry!

@momolog
Copy link

momolog commented Jan 20, 2025

Does it behave differently in your case?

No, it doesn't, you are right, I had overlooked that, thanks.

But I wouldn't recommend handling it this way. Instead I would store an new VAT-Number in the DB marked as :not_verified, and start validation it in a background job and mark it as :verified or :invalid when the web service is reachable. Valvat::Lookup.validate(record.vat_number) returns nil if the web service is down; so I would keep retrying it till you get an definitive answer back.

Makes sense, thanks for the explanation.

It is out of the scope of this gem to handle the background processing, sorry!

Absolutely. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants