From 799eabbee469cd88bf2f445a2c05b4e049f4ec20 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 22 Sep 2022 17:14:56 -0400 Subject: [PATCH] Increase memory and duration of scoreContracts --- functions/src/score-contracts.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/functions/src/score-contracts.ts b/functions/src/score-contracts.ts index 34462d5c..52ef39d4 100644 --- a/functions/src/score-contracts.ts +++ b/functions/src/score-contracts.ts @@ -6,8 +6,9 @@ import { Contract } from '../../common/contract' import { log } from './utils' import { removeUndefinedProps } from '../../common/util/object' -export const scoreContracts = functions.pubsub - .schedule('every 1 hours') +export const scoreContracts = functions + .runWith({ memory: '4GB', timeoutSeconds: 540 }) + .pubsub.schedule('every 1 hours') .onRun(async () => { await scoreContractsInternal() }) @@ -49,7 +50,8 @@ async function scoreContractsInternal() { let dailyScore: number | undefined if (contract.outcomeType === 'BINARY' && contract.mechanism === 'cpmm-1') { - dailyScore = popularityScore * Math.abs(contract.probChanges.day) + const percentChange = Math.abs(contract.probChanges.day) + dailyScore = popularityScore * percentChange } if (