Revert "Fix auto resolve markets query"

This reverts commit b405bd453a.
This commit is contained in:
James Grugett 2022-06-14 23:30:58 -05:00
parent b405bd453a
commit 26921451a8

View File

@ -60,14 +60,12 @@ export const autoResolveMarkets = functions.pubsub
firestore
.collection('contracts')
.where('isResolved', '==', false)
.where('closeTime', '>', Date.now())
.where('autoResolutionTime', '<', Date.now())
)
const closedContracts = contracts.filter(
(c) => c.closeTime && c.closeTime < Date.now()
)
await batchedWaitAll(
closedContracts.map((contract) => async () => {
contracts.map((contract) => async () => {
const result = await autoResolve(contract)
console.log('resolved', contract.slug, 'result:', result)