-
Notifications
You must be signed in to change notification settings - Fork 5
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
Confused in the below code lines #1
Comments
Hello Andreas, Regards, |
Hi Scott,
That's great. I thought it was something related with GO net/http internals
which I didn't get. This hack proves that it is always better to develop
your own SDK client instead of an autogenerated one from swagger-tools or
similar.
I really enjoy your book, had a couple of projects in Terraform before a
couple of years and started with the "Terraform Up and Running" which was
the only available at the moment which helped a lot, with the "Terraform in
Action" I understood a lot of the internals in Terraform, how to organize a
project etc. But I believe developing your own custom provider gives a lot
of satisfaction - especially to me because I am trying to learn Go at the
same time.
Thank you for the response and your time,
AndreasPo
…On Tue, Mar 15, 2022 at 5:37 PM Scott Winkler ***@***.***> wrote:
Hello Andreas,
thank you for reading my book. you have found some of the code i am less
proud of. this was a hack i did to get the api to work on AWS lambda. See
lambda has a cold start which can be a few seconds. During that time it has
to first start up the gin server, and is therefore not able to process the
request. Instead, it hangs for the full 30 seconds before returning
nothing. What this does is make a request to "wake up" the lambda function,
then the next request will surely succeed. Not great, but the best i was
able to come up with. If you know of a better way, I would be happy to have
your PR.
Regards,
Scott
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOAHHVQMZT7KMX2ZCLR4S3VACVFHANCNFSM5QYE4TPQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
*Polychronopoulos I. Andreas *
|
Thank you for your kind words. I hope to write a version two of the book someday. If you have not already done so, I would appreciate if you could please leave a positive review, it really helps me out. |
I can't recall if I have already written a review, however I can't find out
from the Manning site where I should click for a book review.
…On Tue, Mar 15, 2022 at 8:40 PM Scott Winkler ***@***.***> wrote:
Thank you for your kind words. I hope to write a version two of the book
someday. If you have not already done so, I would appreciate if you could
please leave a positive review, it really helps me out.
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOAHHWMSQS5KX3TB6N4IHLVADKSJANCNFSM5QYE4TPQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
*Polychronopoulos I. Andreas *
|
I am bit confused with the lines under the comment "wake up the function ?", why you are calling the newRequest() again and then you are calling the http.Do() twice ?
file : petstore.go
The text was updated successfully, but these errors were encountered: