From 899244bd3fc461288abdc851144b2b2057a1bedf Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 6 May 2022 14:49:24 -0400 Subject: [PATCH] remove batching for antes for numeric markets --- functions/src/create-contract.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/functions/src/create-contract.ts b/functions/src/create-contract.ts index b748eca6..a51497ae 100644 --- a/functions/src/create-contract.ts +++ b/functions/src/create-contract.ts @@ -188,18 +188,16 @@ export const createContract = functions ante ) - await firestore.runTransaction(async (transaction) => { - for (let anteBet of antes) { - const anteBetDoc = firestore - .collection(`contracts/${contract.id}/bets`) - .doc() + for (let i = 0; i < antes.length; i++) { + const anteBetDoc = firestore + .collection(`contracts/${contract.id}/bets`) + .doc() - await transaction.set(anteBetDoc, { - id: anteBetDoc.id, - ...anteBet, - }) - } - }) + await anteBetDoc.set({ + id: anteBetDoc.id, + ...antes[i], + }) + } } }