File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
2nd-gen/instrument-with-opentelemetry/functions Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change
1
+ # This loads the telemetry library before functions framework because
2
+ # The Open Telemetry SDK must be the first thing that runs
3
+ NODE_OPTIONS = --require=./tracing.js
Original file line number Diff line number Diff line change @@ -49,11 +49,12 @@ async function calculatePrice(productIds) {
49
49
async function calculateDiscount ( productIds ) {
50
50
const timer = new Timer ( ) ;
51
51
52
+
52
53
let discountUsd = 0 ;
53
54
const processConcurrently = sliceIntoChunks ( productIds , 10 )
54
55
. map ( async ( productIds ) => {
55
56
const discounts = await db . collection ( "discounts" )
56
- . where ( "products" , "array-contains" , productIds )
57
+ . where ( "products" , "array-contains-any " , productIds )
57
58
. get ( ) ;
58
59
for ( const discount of discounts . docs ) {
59
60
discountUsd += discount . data ( ) . usd || 0 ;
You can’t perform that action at this time.
0 commit comments