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

10309 Opex: Fix MaxListenersExceededWarning #5244

Merged
merged 5 commits into from
Aug 15, 2024

Conversation

Mwindo
Copy link
Contributor

@Mwindo Mwindo commented Aug 13, 2024

In app.ts and app-public.ts, we run the logging middleware via app.use(logger()). However, the way logger is set up means that we are re-creating our logger--and re-adding related event listeners--on every request. This quickly leads to a MaxListenersExceededWarning (for instance, just refresh the page a few times). This PR fixes the issue by using a closure to create the logger once at app initialization rather than once per request.

@Mwindo Mwindo marked this pull request as ready for review August 13, 2024 21:01
@jimlerza jimlerza merged commit 43cc135 into ustaxcourt:staging Aug 15, 2024
44 checks passed
@jimlerza jimlerza deleted the 10309-opex-event-emitters branch August 15, 2024 00:29
@jimlerza jimlerza mentioned this pull request Aug 16, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants