Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command line option for disabling scheduled events. #1185

Merged
merged 2 commits into from Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -115,6 +115,7 @@ All CLI options are optional:
--corsDisallowCredentials When provided, the default Access-Control-Allow-Credentials header value will be passed as 'false'. Default: true
--corsExposedHeaders Used as additional Access-Control-Exposed-Headers header value for responses. Delimit multiple values with commas. Default: 'WWW-Authenticate,Server-Authorization'
--disableCookieValidation Used to disable cookie-validation on hapi.js-server
--disableScheduledEvents Disables all scheduled events. Overrides configurations in serverless.yml.
--dockerHost The host name of Docker. Default: localhost
--dockerHostServicePath Defines service path which is used by SLS running inside Docker container
--dockerNetwork The network that the Docker container will connect to
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -102,6 +102,7 @@
"Gert Jansen van Rensburg (https://github.com/gertjvr)",
"Guillaume Carbonneau (https://github.com/guillaume)",
"György Balássy (https://github.com/balassy)",
"James Relyea (https://github.com/james-relyea)",
"Jarda Snajdr (https://github.com/jsnajdr)",
"Jaryd Carolin (https://github.com/horyd)",
"Jeff Hall (https://github.com/electrikdevelopment)",
Expand Down
2 changes: 1 addition & 1 deletion src/ServerlessOffline.js
Expand Up @@ -94,7 +94,7 @@ export default class ServerlessOffline {
eventModules.push(this._createHttp(httpEvents))
}

if (scheduleEvents.length > 0) {
if (!this.#options.disableScheduledEvents && scheduleEvents.length > 0) {
eventModules.push(this._createSchedule(scheduleEvents))
}

Expand Down
4 changes: 4 additions & 0 deletions src/config/commandOptions.js
Expand Up @@ -28,6 +28,10 @@ export default {
usage: 'Used to disable cookie-validation on hapi.js-server',
type: 'boolean',
},
disableScheduledEvents: {
usage:
'Disables all scheduled events. Overrides configurations in serverless.yml.',
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It misses a type property

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, amended that.

enforceSecureCookies: {
usage: 'Enforce secure cookies',
type: 'boolean',
Expand Down
1 change: 1 addition & 0 deletions src/config/defaultOptions.js
Expand Up @@ -8,6 +8,7 @@ export default {
corsAllowOrigin: '*',
corsExposedHeaders: 'WWW-Authenticate,Server-Authorization',
disableCookieValidation: false,
disableScheduledEvents: false,
dockerHost: 'localhost',
dockerHostServicePath: null,
dockerNetwork: null,
Expand Down