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

Update dbConnect.js #19644

Merged
merged 5 commits into from
Dec 30, 2020
Merged

Update dbConnect.js #19644

merged 5 commits into from
Dec 30, 2020

Conversation

mustafaKamal-fe
Copy link
Contributor

The previous logic was in my opinion prone to errors in situations when different calls to this function from different locations may happen at the same time ( like a race condition ). If the readyState is anything but not 0, then we must not try to perform a new connection as this may cause consequent connections!

I hope this makes sense

The previous logic was in my opinion prone to errors in situations when different calls to this function from different locations may happen at the same time ( like a race condition  ). If the readyState is anything but not 0, then we must not try to perform a new connection as this may cause consequent connections!

I hope this makes sense
@ijjk ijjk added the examples Issue/PR related to examples label Nov 29, 2020
@vercel vercel bot temporarily deployed to Preview November 29, 2020 01:33 Inactive
@ijjk
Copy link
Member

ijjk commented Nov 29, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
buildDuration 8.6s 8.6s -13ms
nodeModulesSize 85 MB 85 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
/ failed reqs 0 0
/ total time (seconds) 2.009 1.985 -0.02
/ avg req/sec 1244.29 1259.16 +14.87
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.128 1.142 ⚠️ +0.01
/error-in-render avg req/sec 2215.98 2188.83 ⚠️ -27.15
Client Bundles (main, webpack, commons)
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-90b3d5a..55ad.js gzip 6.54 kB 6.54 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
index.html gzip 614 B 614 B
link.html gzip 621 B 621 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
buildDuration 10.5s 10.3s -194ms
nodeModulesSize 85 MB 85 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-90b3d5a..55ad.js gzip 6.54 kB 6.54 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary mustafaKamal-fe/next.js patch-1 Change
_error.js 996 kB 996 kB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 996 kB 996 kB
link.js 1.05 MB 1.05 MB
routerDirect.js 1.04 MB 1.04 MB
withRouter.js 1.04 MB 1.04 MB
Overall change 5.13 MB 5.13 MB
Commit: f0cdeea

@vercel vercel bot temporarily deployed to Preview December 30, 2020 15:46 Inactive
@vercel vercel bot temporarily deployed to Preview December 30, 2020 15:49 Inactive
Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@vercel vercel bot temporarily deployed to Preview December 30, 2020 16:11 Inactive
@vercel vercel bot temporarily deployed to Preview December 30, 2020 16:26 Inactive
@lfades lfades merged commit 4e27e00 into vercel:canary Dec 30, 2020
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants