-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Token for multiple request #81
Comments
Not the maintainer, but more code might help. The construction of your auth client at least? |
Hi, yes, sorry, here's the code: https://gist.github.com/anddimario/6338925 Thanks for your time. |
Is there any chance, this problem is occurring during token refresh? There is a racing condition in this case if there are multiple token refreshing requests are sent out. |
Hi, i'm looking for use something with async, what do you think it could be the best method to do multiple request? Thanks for your time. |
Google implements OData's batch protocol which cant be consumed by the native HTTP implementation of node which leads to implementing and http client in pure JS or implementing a native OData client. Both are not worth the effort, so I'd suggest using async. What you can do to avoid your problem, before starting the requests check the expiration date of the token and retrieve a new access token. I'll try to address this in the lib, but temporarily you can solve the problem by making sure your access token is not expired before starting the requests. |
Hi, i'm usign this link to test my token: https://www.googleapis.com/oauth2/v1/tokeninfo?id_token= Thanks for your time. |
Is it possible for to dump the request bodies and headers so I can try to On Tue, Sep 3, 2013 at 11:03 AM, anddimario notifications@github.comwrote:
|
Hi, i've created a function to refresh token function and it seems that the principal problem disappears, but i've the resource limit problem, i'm using sleep too, but it seems that client make all request at the same time. |
Hi - I recently used apache bench to load test (100 total reqs, 10 at a time) an API endpoint that uses the client to call a Google API. The benchmark only got to request 32 before node threw: [Error: No access or refresh token is set.] Any info I can contribute to debug this? |
Just released 1.0.3 which will likely address this issue. The access token will be refreshed prior to initial request if has expired or is missing and you have a refresh token set. If the request fails due to a missing, invalid, or revoked access token, we will no longer attempt to refresh and re-attempt the request. https://github.com/google/google-api-nodejs-client/releases/tag/1.0.3 |
Hi, i'm creating a batch script that execute requests with async, there are about 20 requests, and on client request i've this error:
It's a random error and not on a specific request and i think it's something like a timeout on oauth.
Here's the code for a request:
Have you some suggestions about this problem?
Thanks for your time.
Best regards
The text was updated successfully, but these errors were encountered: