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

instagram.js could be more efficient #4

Closed
saiichihashimoto opened this issue Jun 13, 2015 · 1 comment
Closed

instagram.js could be more efficient #4

saiichihashimoto opened this issue Jun 13, 2015 · 1 comment

Comments

@saiichihashimoto
Copy link
Contributor

Right now, instagram.js a big async.waterfall. The first function uses async.map to call ig.tag_search on each trend to get an instagram tag for each twitter trend. The next function uses another async.map to get those tags and run ig.tag_media_recent on each 50 times so we can change each tag into 100 pictures. In other words, you have one map feeding into another map. Cool.

The problem here is that ig.tag_search could run really quickly for one ig.tag_search but not for some others, but that first result won't move onto its 50 ig.tag_media_recents, because nothing in the second async.map will run until the first one is completely done.

TLDR; Have an async.map that has an async.waterfall inside of it instead of the other way around so each async.map isn't blocking the one before it.

PS. If one ig.tag_search or ig.tag_media_recent errors, you want to throw away that result, but not all of them, right? Right now, an error anywhere will tell everything to quit.

@saiichihashimoto
Copy link
Contributor Author

No one cares and I don't want my issues cluttered so bye bye.

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

1 participant