Skip to content

Commit 29a55af

Browse files
authored
Updating runWith enums (#884)
Updating runWith enums
1 parent 98bf467 commit 29a55af

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Functions may now be deployed with 8GB RAM
2+
- Functions may now be deployed to europe-central2 (Warsaw)
3+
- Functions may now reserve a minimum number of instances (updated CLI required)

src/cloud-functions.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export namespace Change {
203203
json: ChangeJson,
204204
customizer: (x: any) => T = reinterpretCast
205205
): Change<T> {
206-
let before = _.assign({}, json.before);
206+
let before = { ...json.before };
207207
if (json.fieldMask) {
208208
before = applyFieldMask(before, json.after, json.fieldMask);
209209
}
@@ -220,7 +220,7 @@ export namespace Change {
220220
after: any,
221221
fieldMask: string
222222
) {
223-
const before = _.assign({}, after);
223+
const before = { ...after };
224224
const masks = fieldMask.split(',');
225225

226226
masks.forEach((mask) => {
@@ -506,13 +506,18 @@ export function optionsToTrigger(options: DeploymentOptions) {
506506
'1GB': 1024,
507507
'2GB': 2048,
508508
'4GB': 4096,
509+
'8GB': 8192,
509510
};
510511
trigger.availableMemoryMb = _.get(memoryLookup, options.memory);
511512
}
512513
if (options.schedule) {
513514
trigger.schedule = options.schedule;
514515
}
515516

517+
if (options.minInstances) {
518+
trigger.minInstances = options.minInstances;
519+
}
520+
516521
if (options.maxInstances) {
517522
trigger.maxInstances = options.maxInstances;
518523
}

src/function-configuration.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const SUPPORTED_REGIONS = [
88
'us-west2',
99
'us-west3',
1010
'us-west4',
11+
'europe-central2',
1112
'europe-west1',
1213
'europe-west2',
1314
'europe-west3',
@@ -43,6 +44,7 @@ export const VALID_MEMORY_OPTIONS = [
4344
'1GB',
4445
'2GB',
4546
'4GB',
47+
'8GB',
4648
] as const;
4749

4850
/**
@@ -107,6 +109,12 @@ export interface RuntimeOptions {
107109
*/
108110
timeoutSeconds?: number;
109111

112+
/**
113+
* Min number of actual instances allowed to be running in parallel
114+
* Instances will be billed while idle.
115+
*/
116+
minInstances?: number;
117+
110118
/**
111119
* Max number of actual instances allowed to be running in parallel
112120
*/

0 commit comments

Comments
 (0)