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

feat: under-pressure integration #155

Merged
merged 1 commit into from
Jan 7, 2021
Merged

Conversation

simoneb
Copy link
Contributor

@simoneb simoneb commented Jan 6, 2021

also 100% test coverage and other minor fixes

Checklist

index.js Outdated
@@ -5,6 +5,10 @@ const fp = require('fastify-plugin')
const Next = require('next')

function fastifyNext (fastify, options, next) {
fastify.register(require('under-pressure'), options.underPressure)
Copy link
Member

Choose a reason for hiding this comment

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

We need to have an if to avoid installing this twice if it's already registered. We should also support underPressure: false to avoid adding it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yeah that makes sense. so under-pressure cannot be installed more than once? I thought it was possible to install it multiple times as long as the different registrations don't step on each other's feet.

having an option to disable it make sense to me. do you think it should be the default value? (of having it disabled I mean)

also 100% test coverage and other minor fixes
@simoneb
Copy link
Contributor Author

simoneb commented Jan 7, 2021

Updated the PR so that under-pressure is disabled by default and can be enabled using underPressure: true, which will use the default options, or underPressure: { ... } which will be provided as options to underPressure

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 871f8ae into fastify:master Jan 7, 2021
@simoneb simoneb deleted the under-pressure branch January 7, 2021 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants