Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
shamsmosowi committed Nov 17, 2022
2 parents 043d991 + 17562df commit 5d477dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/functionBuilder/compiler/loader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ export const getConfigFromTableSchema = async (
};
}, {});

const runtimeOptions = schemaData.runtimeOptions ?? {};

const config: TableConfig = {
derivativeColumns,
defaultValueColumns,
documentSelectColumns,
fieldTypes,
extensions,
runtimeOptions,
};
if (schemaData.searchIndex) {
config.searchIndex = {
Expand Down Expand Up @@ -82,6 +85,7 @@ export const combineConfigs = (configs: any[]) =>
fieldTypes,
extensions,
searchIndex,
runtimeOptions,
} = cur;
return {
derivativeColumns: [...acc.derivativeColumns, ...derivativeColumns],
Expand All @@ -100,6 +104,7 @@ export const combineConfigs = (configs: any[]) =>
searchIndices: searchIndex
? [...acc.searchIndices, searchIndex]
: acc.searchIndices,
runtimeOptions,
};
},
{
Expand All @@ -125,6 +130,7 @@ export const generateFile = async (configData, buildFolderTimestamp) => {
projectId,
region,
searchHost,
runtimeOptions,
} = configData;
const serializedConfigData = {
fieldTypes: JSON.stringify(fieldTypes),
Expand All @@ -136,6 +142,7 @@ export const generateFile = async (configData, buildFolderTimestamp) => {
extensionsConfig: serialiseExtension(extensions),
runtimeOptions: JSON.stringify({
serviceAccount: `rowy-functions@${projectId}.iam.gserviceaccount.com`,
...runtimeOptions,
}),
region: JSON.stringify(region),
searchHost: JSON.stringify(searchHost),
Expand Down
7 changes: 7 additions & 0 deletions src/functionBuilder/compiler/loader/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export interface IExtension {
extensionBody: string;
conditions: string;
}

export interface IRuntimeOptions {
memory?: "128MB" | "256MB" | "512MB" | "1GB" | "2GB" | "4GB" | "8GB";
timeoutSeconds?: number;
}

export type TriggerPathType =
| "collection"
| "collectionGroup"
Expand All @@ -43,4 +49,5 @@ export interface TableConfig {
id: string;
fields: string[];
};
runtimeOptions: IRuntimeOptions;
}

0 comments on commit 5d477dc

Please sign in to comment.