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

fix: prevent max listeners warning #1767

Merged
merged 1 commit into from
Aug 9, 2019
Merged

Conversation

emonddr
Copy link
Contributor

@emonddr emonddr commented Aug 1, 2019

Description

If establishing a database connection is slow and database migration runs and there are many models, sql operations are queued up and this leads to the node.js max emitters exceeded warning.

A default value for max emitters has now been introduced, and it can also be configured in datasources.json.

Related issues

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide

lib/datasource.js Outdated Show resolved Hide resolved
lib/datasource.js Outdated Show resolved Hide resolved
lib/datasource.js Outdated Show resolved Hide resolved
@nabdelgadir nabdelgadir force-pushed the dremond_migrate_errors branch 2 times, most recently from 487957a to bb311a7 Compare August 7, 2019 17:02
Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

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

:shipit: LGTM just a nitpick for the test.

test/datasource.test.js Outdated Show resolved Hide resolved
Copy link
Member

@dhmlau dhmlau left a comment

Choose a reason for hiding this comment

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

I'm not familiar with this listener area, but your changes look reasonable to me. Thanks.

@nabdelgadir nabdelgadir force-pushed the dremond_migrate_errors branch from bb311a7 to 39ebf88 Compare August 8, 2019 14:30
If establishing a database connection is slow
and database migration runs and there are many
models, sql operations are queued up and this
leads to the node.js max emitters exceeded
warning.

A default value for max emitters has now
been introduced, and it can also be configured
in datasources.json.

Co-authored-by: Dominique Emond <[email protected]>
@nabdelgadir nabdelgadir force-pushed the dremond_migrate_errors branch from 39ebf88 to bca6315 Compare August 9, 2019 13:06
@nabdelgadir nabdelgadir merged commit a90dc0e into master Aug 9, 2019
@delete-merged-branch delete-merged-branch bot deleted the dremond_migrate_errors branch August 9, 2019 13:18
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.

5 participants