Skip to content

Commit ce9c490

Browse files
committed
add maxAge and failurePolicy docs
1 parent 4e3fe37 commit ce9c490

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

readme.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module.exports = {
8686
routes: [
8787
{
8888
path: '/',
89-
function: req => [200, { message: 'hello-world' }],
89+
function: (req) => [200, { message: 'hello-world' }],
9090
},
9191
],
9292
};
@@ -106,20 +106,21 @@ module.exports = [hello];
106106
- Service configuration is exported from the `index.js` file in the service's directory
107107
- the config object's structure is as follows:
108108

109-
| key | required | type | description |
110-
| -------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
111-
| basePath | true | string | defines the services base-path |
112-
| resourcePath | false | string | defines which documents in the db should be published when changed ex: `'posts/{id}'` (uses the cloud functions firestore triggers syntax) |
113-
| schema | false | object | should contain a reference to the `require`d schema file |
114-
| postSchema | false | object | optional alternative used for services that require special fields during creation |
115-
| publishChanges | false | boolean | whether the service should publish changes to it's data as messages on cloud pub sub |
116-
| withModifiers | false | boolean | declares that the schema can contain `writeModifier` keys that define a function that will modify values before they are processes/saved |
117-
| middleware | false | Array | ExpressJs middleware that will apply to all routes in the service |
118-
| routes | false | Array | these are the functions triggered within the service by http requests (see routes below) |
119-
| events | false | Array | pub sub events that the service will listed to (see events below) |
120-
| schedule | false | Array | cloud schedules that will trigger functions within this service (see schedule below) |
121-
| keepAlive | false | boolean | whether a scheduled function should be set up that will trigger the http function (routes) every 5 minutes to prevent cold starts\* |
122-
| runtimeOptions | false | object | An object containing 2 optional properties. `memory`: amount of memory to allocate to the function, possible values are: '128MB', '256MB', '512MB', '1GB', and '2GB'. `timeoutSeconds`: timeout for the function in seconds, possible values are 0 to 540. |
109+
| key | required | type | description |
110+
| -------------- | --------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
111+
| basePath | true | string | defines the services base-path |
112+
| resourcePath | false | string | defines which documents in the db should be published when changed ex: `'posts/{id}'` (uses the cloud functions firestore triggers syntax) |
113+
| schema | false | object | should contain a reference to the `require`d schema file |
114+
| postSchema | false | object | optional alternative used for services that require special fields during creation |
115+
| publishChanges | false | boolean | whether the service should publish changes to it's data as messages on cloud pub sub |
116+
| withModifiers | false | boolean | declares that the schema can contain `writeModifier` keys that define a function that will modify values before they are processes/saved |
117+
| middleware | false | Array | ExpressJs middleware that will apply to all routes in the service |
118+
| routes | false | Array | these are the functions triggered within the service by http requests (see routes below) |
119+
| events | false | Array | pub sub events that the service will listed to (see events below) |
120+
| schedule | false | Array | cloud schedules that will trigger functions within this service (see schedule below) |
121+
| keepAlive | false | boolean | whether a scheduled function should be set up that will trigger the http function (routes) every 5 minutes to prevent cold starts\* |
122+
| runtimeOptions | false | object | An object containing 3 optional properties. `memory`: amount of memory to allocate to the function, possible values are: '128MB', '256MB', '512MB', '1GB', and '2GB'. `timeoutSeconds`: timeout for the function in seconds, possible values are 0 to 540. `failurePolicy`: When `true`, the function should be retried on failure. default: `false`. |
123+
| maxAge | undefined | number | The maxAge in ms before the event listener will not attempt to process an event. Can be used to prevent infinite retries of a retry-able event |
123124

124125
\* Though billing is required, you can expect the overall cost to be manageable, as each Cloud Scheduler job costs \$0.10 (USD) per month, and there is an allowance of three free jobs per Google account (as of the time of writing). \* The keepAlive feature adds a route to the service at '/heartbeat'. This will not conflict with wildcard routes in the service but would conflict with a route named the same.
125126

0 commit comments

Comments
 (0)