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

Optimize current purchase window updating #208

Open
AndrewLester opened this issue Aug 4, 2021 · 0 comments
Open

Optimize current purchase window updating #208

AndrewLester opened this issue Aug 4, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@AndrewLester
Copy link
Member

AndrewLester commented Aug 4, 2021

Currently updateCurrentPurchaseWindow fetches all purchase windows in order to loop through them and check which one is the current window. It does this through a call to getDocuments with the collection name 'purchase_windows'.

This call could be replaced by a call to getDocumentsWhere with a condition to only find purchase windows that have the same dayOfWeek as the current day. Specify this condition in the function's queryOnQueryable parameter. Something like:

(queryable) => queryable.where('dayOfWeek', '==', new Date().getDay());
@AndrewLester AndrewLester added the enhancement New feature or request label Aug 4, 2021
@AndrewLester AndrewLester added this to the Future milestone Aug 4, 2021
@AndrewLester AndrewLester changed the title Optimize current purchase window fetch Optimize current purchase window updating Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant