Increase memory and duration of scoreContracts

This commit is contained in:
James Grugett 2022-09-22 17:14:56 -04:00
parent ffba70d556
commit 799eabbee4

View File

@ -6,8 +6,9 @@ import { Contract } from '../../common/contract'
import { log } from './utils' import { log } from './utils'
import { removeUndefinedProps } from '../../common/util/object' import { removeUndefinedProps } from '../../common/util/object'
export const scoreContracts = functions.pubsub export const scoreContracts = functions
.schedule('every 1 hours') .runWith({ memory: '4GB', timeoutSeconds: 540 })
.pubsub.schedule('every 1 hours')
.onRun(async () => { .onRun(async () => {
await scoreContractsInternal() await scoreContractsInternal()
}) })
@ -49,7 +50,8 @@ async function scoreContractsInternal() {
let dailyScore: number | undefined let dailyScore: number | undefined
if (contract.outcomeType === 'BINARY' && contract.mechanism === 'cpmm-1') { 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 ( if (