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

fix(exercise 12): test GET request for fail #446 #609

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hoijui
Copy link

@hoijui hoijui commented Feb 18, 2018

This is still missing most of the translations for the doc change.
This implements a TODO comment.

Note that I am totally new to Node.js and JavaScript, so i might be doing many things wrong here.
Please give feedback so i can fix it.
have a good day! :-)

@hoijui hoijui force-pushed the master branch 2 times, most recently from 756bc29 to cd27c4d Compare February 19, 2018 00:15
var methods = ['post', 'get']

var mi = 0
var miv = setInterval(function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get rid of the setInterval and setTimeout calls somehow? These make the code complex.

@hoijui
Copy link
Author

hoijui commented Feb 25, 2018

do you have any hints maybe? as said, i am totally new to this.

@AnshulMalik
Copy link
Contributor

Yeah, we can think of this as if we are using setInterval just to call the function one more time with another parameter(incrementing count).

One way is we can use recursion, after finishing the first call, it'll go call the same function with next parameter.

Other is to use a for loop, this approach will be async which means all the requests will be sent in parallel.

You can try and experiment with these

@hoijui
Copy link
Author

hoijui commented Jun 27, 2018

hmmm.. i am sorry to respond this late.
i remember i first tried simpler solutions liek the ones you sugguested, but the tests would fail, because there were things we had to wait for, so in some way, waiting will be necessary.
should i use some wait(<milliseconds>) or sleep(<milliseconds>) kind of call?

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

Successfully merging this pull request may close these issues.

None yet

2 participants