Saturday 18 February 2017

Newbie post: https request/agent help

I'm working on a learning project that involves downloading a json file from a redis queue URL, then processing the contents and inserting the new documents into a MongoDB. Currently I'm trying to save the file to disk, then process the objects within. I believe I'm running into problems with getting my callbacks correct with async get requests, as only 0 byte files are being created on disk. Running the code to download and save a file to disk only once in a separate file works, but once I try to loop this function is when I have problems.EDIT: I should mention that it can take up to 5 seconds to get a reply from this URL and that the ttw=5 controls this behavior in the link below.Here is a pastebin link:http://ift.tt/2lZ187h help is appreciated. Thanks. (And I'm not even sure if the code after saving the file will work how it is, as I haven't gotten the code to run that far yet).

Submitted February 18, 2017 at 10:31PM by namrak

No comments:

Post a Comment