From 7eb0cabd4be1863830ee5dee83c1aad38de745ff Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:55:22 -0400 Subject: [PATCH] bump memory & fix region --- .../combiner/src/common/handlers.ts | 1 + .../phone-number-privacy/combiner/src/index.ts | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/phone-number-privacy/combiner/src/common/handlers.ts b/packages/phone-number-privacy/combiner/src/common/handlers.ts index c675534b8f4..e9717e2820a 100644 --- a/packages/phone-number-privacy/combiner/src/common/handlers.ts +++ b/packages/phone-number-privacy/combiner/src/common/handlers.ts @@ -57,6 +57,7 @@ export function meteringHandler( const eventLoopLag = Date.now() - eventLoopLagMeasurementStart logger.info({ eventLoopLag }, 'Measure event loop lag') }) + // TODO:(soloseng): session ID may not always exist const startMark = `Begin ${req.url}/${req.body.sessionID}` const endMark = `End ${req.url}/${req.body.sessionID}` const entryName = `${req.url}/${req.body.sessionID} latency` diff --git a/packages/phone-number-privacy/combiner/src/index.ts b/packages/phone-number-privacy/combiner/src/index.ts index fd86e715439..9fc648cbad0 100644 --- a/packages/phone-number-privacy/combiner/src/index.ts +++ b/packages/phone-number-privacy/combiner/src/index.ts @@ -1,5 +1,4 @@ -import { getContractKitWithAgent } from '@celo/phone-number-privacy-common' -import { setGlobalOptions } from 'firebase-functions/v2' +import { getContractKit } from '@celo/phone-number-privacy-common' import * as functions from 'firebase-functions/v2/https' import config from './config' import { startCombiner } from './server' @@ -7,10 +6,14 @@ import { blockchainApiKey, minInstancesConfig, requestConcurency } from './utils require('dotenv').config() -setGlobalOptions({ region: 'us-central1' }) - export const combinerGen2 = functions.onRequest( - { minInstances: minInstancesConfig, secrets: [blockchainApiKey], concurrency: requestConcurency }, - startCombiner(config, getContractKitWithAgent(config.blockchain)) + { + minInstances: minInstancesConfig, + secrets: [blockchainApiKey], + concurrency: requestConcurency, + memory: '512MiB', + region: 'us-central1', + }, + startCombiner(config, getContractKit(config.blockchain)) ) export * from './config'