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

Faster adding of new images from Reddit #31

Closed
nielsmaerten opened this issue Sep 28, 2017 · 0 comments
Closed

Faster adding of new images from Reddit #31

nielsmaerten opened this issue Sep 28, 2017 · 0 comments

Comments

@nielsmaerten
Copy link
Owner

nielsmaerten commented Sep 28, 2017

Current behavior:

  • Top posts are fetched from Reddit
  • Masterlist is fetched from Firebase
  • Function iterates over the posts, and each post that's not in the Masterlist is added to Firebase

Needless to say, this is not efficient...

Suggested behavior:

  • Posts are fetched from Reddit
  • All posts are sent to Firebase using a batch update call

This would result in a null operation for posts that are already in the Masterlist, it's the same data, so nothing changes.
For posts that are not already in there, this will result in new nodes being created.
Triggering in turn the onNewMasterImage function, which will fill in the remaining details.

@nielsmaerten nielsmaerten changed the title Faster adding of new images from Reddit's Faster adding of new images from Reddit Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant