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

refactor(core): env variable to control slow threshold of token factory #13799

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

H4ad
Copy link
Contributor

@H4ad H4ad commented Jul 18, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Today, there's no way to change the threshold we added for slow serialization.

Refs: #12738 (comment)

What is the new behavior?

Now, we can control the amount of time in MS using NEST_TOKEN_FACTORY_SLOW_THRESHOLD_MS

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls
Copy link

Pull Request Test Coverage Report for Build ecf984e0-9894-4582-afce-61a77c6239da

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 92.209%

Totals Coverage Status
Change from base Build 7ea6f01d-9fcc-4d6c-90b4-f217d2306325: 0.001%
Covered Lines: 6746
Relevant Lines: 7316

💛 - Coveralls

Copy link

@kazazor kazazor left a comment

Choose a reason for hiding this comment

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

Looks simple and effective, thank you!

@kazazor
Copy link

kazazor commented Aug 12, 2024

Hi @H4ad , thank you so much for making this PR! Indeed, this warning is driving us crazy today :)

Is anything blocking you from merging it and having it in the next patch version of NestJS? Would be great to have it

@kazazor
Copy link

kazazor commented Sep 9, 2024

Sorry for nagging here, but can someone from the NestJS team approve/merge this PR by any chance?
This would really help a lot of people

@mike-ayres
Copy link

bump

@H4ad
Copy link
Contributor Author

H4ad commented Nov 27, 2024

/cc @kamilmysliwiec Can we merge this to release in the v11?

@kamilmysliwiec
Copy link
Member

We probably won't need that in v11 as the reference algorithm is going to be used by default. If someone decides to use deep-hash instead, then they will be advised to switch back to reference (instead of bumping the threshold value)

@H4ad
Copy link
Contributor Author

H4ad commented Nov 27, 2024

Do you think is worthy to include only in v10? Otherwise, I will close this PR

@arrrrny

This comment was marked as off-topic.

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.

9 participants