@@ -2,25 +2,22 @@ const functions = require("firebase-functions");
2
2
3
3
// [START runtimeMinInstances]
4
4
exports . getAutocompleteResponse = functions
5
- . runWith (
6
- // Keep 5 instances warm for this latency-critical function
7
- {
8
- minInstances : 5 ,
9
- }
10
- )
5
+ . runWith ( {
6
+ // Keep 5 instances warm for this latency-critical function
7
+ minInstances : 5 ,
8
+ } )
11
9
. https . onCall ( ( data , context ) => {
12
10
// Autocomplete a user's search term
13
11
} ) ;
14
12
// [END runtimeMinInstances]
15
13
14
+
16
15
// [START runtimeMaxInstances]
17
16
exports . mirrorOrdersToLegacyDatabase = functions
18
- . runWith (
19
- // Legacy database only supports 100 simultaneous connections
20
- {
21
- maxInstances : 100 ,
22
- }
23
- )
17
+ . runWith ( {
18
+ // Legacy database only supports 100 simultaneous connections
19
+ maxInstances : 100 ,
20
+ } )
24
21
. firestore . document ( "orders/{orderId}" )
25
22
. onWrite ( ( change , context ) => {
26
23
// Connect to legacy database
@@ -29,14 +26,12 @@ exports.mirrorOrdersToLegacyDatabase = functions
29
26
30
27
// [START runtimeTimeoutMemory]
31
28
exports . convertLargeFile = functions
32
- . runWith (
33
- // Ensure the function has enough memory and time
34
- // to process large files
35
- {
36
- timeoutSeconds : 300 ,
37
- memory : "1GB" ,
38
- }
39
- )
29
+ . runWith ( {
30
+ // Ensure the function has enough memory and time
31
+ // to process large files
32
+ timeoutSeconds : 300 ,
33
+ memory : "1GB" ,
34
+ } )
40
35
. storage . object ( )
41
36
. onFinalize ( ( object ) => {
42
37
// Do some complicated things that take a lot of memory and time
0 commit comments