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: support cls-hooked / tests #11584

Merged
merged 2 commits into from Oct 20, 2019
Merged

feat: support cls-hooked / tests #11584

merged 2 commits into from Oct 20, 2019

Conversation

@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Oct 20, 2019

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

@codecov
Copy link

@codecov codecov bot commented Oct 20, 2019

Codecov Report

Merging #11584 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11584      +/-   ##
==========================================
- Coverage   96.26%   96.26%   -0.01%     
==========================================
  Files          94       94              
  Lines        9191     9190       -1     
==========================================
- Hits         8848     8847       -1     
  Misses        343      343
Impacted Files Coverage Δ
lib/sequelize.js 95.93% <100%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 766cfa4...8c3c67d. Read the comment docs.

@sushantdhiman sushantdhiman merged commit 95104b6 into master Oct 20, 2019
0 of 2 checks passed
@sushantdhiman sushantdhiman deleted the cls-hooked branch Oct 20, 2019
// patch bluebird to bind all promise callbacks to CLS namespace
clsBluebird(ns, Promise);
Promise.config({
asyncHooks: true
Copy link
Contributor

@jedwards1211 jedwards1211 Apr 20, 2020

Choose a reason for hiding this comment

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

@sushantdhiman builtlin Promises automatically support async hooks right? Want to know if I need to replace this with something when we get rid of bluebird.

Copy link
Member

@papb papb Apr 20, 2020

Choose a reason for hiding this comment

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

Good question @jedwards1211, I don't know the answer, hopefully @sushantdhiman does. However, I'd guess that you could just try removing it, in theory we should have tests that fail if this stops working...

Copy link
Contributor Author

@sushantdhiman sushantdhiman Apr 21, 2020

Choose a reason for hiding this comment

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

@jedwards1211 No, you need to manually enable them, https://nodejs.com/api/async_hooks.html#async_hooks_promise_execution_tracking. But we don't need to enable anything. cls-hooked enable those api when namespace is created.

So no change will be required at sequelize level

Copy link
Contributor

@jedwards1211 jedwards1211 Apr 21, 2020

Choose a reason for hiding this comment

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

okay great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants