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

Service not being used with Initializer causing Timeouts #877

Closed
rcronin opened this issue Feb 23, 2023 · 2 comments
Closed

Service not being used with Initializer causing Timeouts #877

rcronin opened this issue Feb 23, 2023 · 2 comments

Comments

@rcronin
Copy link

rcronin commented Feb 23, 2023

return (targetPrototype: any, propertyKey: string | symbol) => {

This needs to only attempt to initialize if any other service or controller depends on the service utilizing the initializer decorator.

In our instance, we have created a shared service as part of a shared package. We cannot start our fastify instance unless we explicitly inject the service. We don't always need to inject this service. When we don't inject it, fastify will not start because the initializer gets called regardless and never resolves the promise.

L2jLiga added a commit that referenced this issue Jul 20, 2023
### Fixed
- application does not start up when service with initializer is loaded but not instantiated (issue [#877](#877))
@L2jLiga
Copy link
Owner

L2jLiga commented Jul 20, 2023

Hi there, can you check with 3.15.1 ? Or do you use v4?

@L2jLiga
Copy link
Owner

L2jLiga commented Oct 19, 2023

Assume as fixed

@L2jLiga L2jLiga closed this as completed Oct 19, 2023
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

No branches or pull requests

2 participants