Add query to help avoid timeout

This commit is contained in:
Ian Philips 2022-08-31 08:03:51 -06:00
parent 27b46f4306
commit 91e5abe76a

View File

@ -15,7 +15,10 @@ export const resetBettingStreaksForUsers = functions.pubsub
})
const resetBettingStreaksInternal = async () => {
const usersSnap = await firestore.collection('users').get()
const usersSnap = await firestore
.collection('users')
.where('currentBettingStreak', '>', 0)
.get()
const users = usersSnap.docs.map((doc) => doc.data() as User)