Skip to content

Commit 7f520c6

Browse files
committed
more compact samples
1 parent a3928fe commit 7f520c6

File tree

1 file changed

+15
-20
lines changed
  • quickstarts/runtime-options/functions

1 file changed

+15
-20
lines changed

quickstarts/runtime-options/functions/index.js

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@ const functions = require("firebase-functions");
22

33
// [START runtimeMinInstances]
44
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+
})
119
.https.onCall((data, context) => {
1210
// Autocomplete a user's search term
1311
});
1412
// [END runtimeMinInstances]
1513

14+
1615
// [START runtimeMaxInstances]
1716
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+
})
2421
.firestore.document("orders/{orderId}")
2522
.onWrite((change, context) => {
2623
// Connect to legacy database
@@ -29,14 +26,12 @@ exports.mirrorOrdersToLegacyDatabase = functions
2926

3027
// [START runtimeTimeoutMemory]
3128
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+
})
4035
.storage.object()
4136
.onFinalize((object) => {
4237
// Do some complicated things that take a lot of memory and time

0 commit comments

Comments
 (0)